2023-06-07 00:14:29

by Dai Ngo

[permalink] [raw]
Subject: [PATCH 1/1] NFSD: add encoding of op_recall flag for write delegation

Modified nfsd4_encode_open to encode the op_recall flag properly
for OPEN result with write delegation granted.

Signed-off-by: Dai Ngo <[email protected]>
---
fs/nfsd/nfs4xdr.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/nfsd/nfs4xdr.c b/fs/nfsd/nfs4xdr.c
index 4590b893dbc8..d7e46b940cce 100644
--- a/fs/nfsd/nfs4xdr.c
+++ b/fs/nfsd/nfs4xdr.c
@@ -3975,7 +3975,7 @@ nfsd4_encode_open(struct nfsd4_compoundres *resp, __be32 nfserr,
p = xdr_reserve_space(xdr, 32);
if (!p)
return nfserr_resource;
- *p++ = cpu_to_be32(0);
+ *p++ = cpu_to_be32(open->op_recall);

/*
* TODO: space_limit's in delegations
--
2.9.5



2023-06-07 14:06:53

by Chuck Lever

[permalink] [raw]
Subject: Re: [PATCH 1/1] NFSD: add encoding of op_recall flag for write delegation



> On Jun 6, 2023, at 7:41 PM, Dai Ngo <[email protected]> wrote:
>
> Modified nfsd4_encode_open to encode the op_recall flag properly
> for OPEN result with write delegation granted.

This appears to have been broken for forever. I can't really nail
down a Fixes: commit, so I will add a Cc: stable.


> Signed-off-by: Dai Ngo <[email protected]>
> ---
> fs/nfsd/nfs4xdr.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/fs/nfsd/nfs4xdr.c b/fs/nfsd/nfs4xdr.c
> index 4590b893dbc8..d7e46b940cce 100644
> --- a/fs/nfsd/nfs4xdr.c
> +++ b/fs/nfsd/nfs4xdr.c
> @@ -3975,7 +3975,7 @@ nfsd4_encode_open(struct nfsd4_compoundres *resp, __be32 nfserr,
> p = xdr_reserve_space(xdr, 32);
> if (!p)
> return nfserr_resource;
> - *p++ = cpu_to_be32(0);
> + *p++ = cpu_to_be32(open->op_recall);
>
> /*
> * TODO: space_limit's in delegations
> --
> 2.9.5
>

--
Chuck Lever



2023-06-07 18:11:55

by Jeffrey Layton

[permalink] [raw]
Subject: Re: [PATCH 1/1] NFSD: add encoding of op_recall flag for write delegation

On Tue, 2023-06-06 at 16:41 -0700, Dai Ngo wrote:
> Modified nfsd4_encode_open to encode the op_recall flag properly
> for OPEN result with write delegation granted.
>
> Signed-off-by: Dai Ngo <[email protected]>
> ---
> fs/nfsd/nfs4xdr.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/fs/nfsd/nfs4xdr.c b/fs/nfsd/nfs4xdr.c
> index 4590b893dbc8..d7e46b940cce 100644
> --- a/fs/nfsd/nfs4xdr.c
> +++ b/fs/nfsd/nfs4xdr.c
> @@ -3975,7 +3975,7 @@ nfsd4_encode_open(struct nfsd4_compoundres *resp, __be32 nfserr,
> p = xdr_reserve_space(xdr, 32);
> if (!p)
> return nfserr_resource;
> - *p++ = cpu_to_be32(0);
> + *p++ = cpu_to_be32(open->op_recall);
>
> /*
> * TODO: space_limit's in delegations

Nice catch!

Reviewed-by: Jeff Layton <[email protected]>