diff options
author | J. Bruce Fields <bfields@redhat.com> | 2014-08-12 11:41:40 -0400 |
---|---|---|
committer | J. Bruce Fields <bfields@redhat.com> | 2014-08-17 12:00:14 -0400 |
commit | f7b43d0c992c3ec3e8d9285c3fb5e1e0eb0d031a (patch) | |
tree | c4a34e08d4d65be8d187a2bcc4a734a95dee353e /fs/nfsd/nfs4xdr.c | |
parent | 1383bf37ce2554d7632f21ee03f3ea815edaf933 (diff) |
nfsd4: reserve adequate space for LOCK op
As of 8c7424cff6 "nfsd4: don't try to encode conflicting owner if low
on space", we permit the server to process a LOCK operation even if
there might not be space to return the conflicting lockowner, because
we've made returning the conflicting lockowner optional.
However, the rpc server still wants to know the most we might possibly
return, so we need to take into account the possible conflicting
lockowner in the svc_reserve_space() call here.
Symptoms were log messages like "RPC request reserved 88 but used 108".
Fixes: 8c7424cff6 "nfsd4: don't try to encode conflicting owner if low on space"
Reported-by: Kinglong Mee <kinglongmee@gmail.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Diffstat (limited to 'fs/nfsd/nfs4xdr.c')
-rw-r--r-- | fs/nfsd/nfs4xdr.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/fs/nfsd/nfs4xdr.c b/fs/nfsd/nfs4xdr.c index 8112ce8f4b23..e771a1a7c6f1 100644 --- a/fs/nfsd/nfs4xdr.c +++ b/fs/nfsd/nfs4xdr.c | |||
@@ -1663,6 +1663,14 @@ nfsd4_decode_compound(struct nfsd4_compoundargs *argp) | |||
1663 | readbytes += nfsd4_max_reply(argp->rqstp, op); | 1663 | readbytes += nfsd4_max_reply(argp->rqstp, op); |
1664 | } else | 1664 | } else |
1665 | max_reply += nfsd4_max_reply(argp->rqstp, op); | 1665 | max_reply += nfsd4_max_reply(argp->rqstp, op); |
1666 | /* | ||
1667 | * OP_LOCK may return a conflicting lock. (Special case | ||
1668 | * because it will just skip encoding this if it runs | ||
1669 | * out of xdr buffer space, and it is the only operation | ||
1670 | * that behaves this way.) | ||
1671 | */ | ||
1672 | if (op->opnum == OP_LOCK) | ||
1673 | max_reply += NFS4_OPAQUE_LIMIT; | ||
1666 | 1674 | ||
1667 | if (op->status) { | 1675 | if (op->status) { |
1668 | argp->opcnt = i+1; | 1676 | argp->opcnt = i+1; |