Commit 50bce06f authored by Chuck Lever's avatar Chuck Lever

NFSD: Report zero space limit for write delegations

Replace the -1 (no limit) with a zero (no reserved space).

This prevents certain non-determinant client behavior, such as
silly-renaming a file when the only open reference is a write
delegation. Such a rename can leave unexpected .nfs files in a
directory that is otherwise supposed to be empty.

Note that other server implementations that support write delegation
also set this field to zero.
Suggested-by: default avatarDai Ngo <dai.ngo@oracle.com>
Signed-off-by: default avatarChuck Lever <chuck.lever@oracle.com>
parent fd19ca36
...@@ -3978,17 +3978,20 @@ nfsd4_encode_open(struct nfsd4_compoundres *resp, __be32 nfserr, ...@@ -3978,17 +3978,20 @@ nfsd4_encode_open(struct nfsd4_compoundres *resp, __be32 nfserr,
nfserr = nfsd4_encode_stateid(xdr, &open->op_delegate_stateid); nfserr = nfsd4_encode_stateid(xdr, &open->op_delegate_stateid);
if (nfserr) if (nfserr)
return nfserr; return nfserr;
p = xdr_reserve_space(xdr, 32);
p = xdr_reserve_space(xdr, XDR_UNIT * 8);
if (!p) if (!p)
return nfserr_resource; return nfserr_resource;
*p++ = cpu_to_be32(open->op_recall); *p++ = cpu_to_be32(open->op_recall);
/* /*
* Always flush on close
*
* TODO: space_limit's in delegations * TODO: space_limit's in delegations
*/ */
*p++ = cpu_to_be32(NFS4_LIMIT_SIZE); *p++ = cpu_to_be32(NFS4_LIMIT_SIZE);
*p++ = cpu_to_be32(~(u32)0); *p++ = xdr_zero;
*p++ = cpu_to_be32(~(u32)0); *p++ = xdr_zero;
/* /*
* TODO: ACE's in delegations * TODO: ACE's in delegations
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment