]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
NFSD: Reserve adequate space for LOCKT operation
authorKinglong Mee <kinglongmee@gmail.com>
Fri, 3 Feb 2017 14:51:46 +0000 (22:51 +0800)
committerJ. Bruce Fields <bfields@redhat.com>
Fri, 17 Feb 2017 21:26:04 +0000 (16:26 -0500)
After tightening the OP_LOCKT reply size estimate, we can get warnings
like:

[11512.783519] RPC request reserved 124 but used 152
[11512.813624] RPC request reserved 108 but used 136

Signed-off-by: Kinglong Mee <kinglongmee@gmail.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
fs/nfsd/nfs4xdr.c

index 7e4df80456fff3462fa4ec5733e943102863a7aa..382c1fd05b4c8dfe2973d466bae01d6963eb7c43 100644 (file)
@@ -1941,12 +1941,12 @@ nfsd4_decode_compound(struct nfsd4_compoundargs *argp)
                } else
                        max_reply += nfsd4_max_reply(argp->rqstp, op);
                /*
-                * OP_LOCK may return a conflicting lock.  (Special case
-                * because it will just skip encoding this if it runs
-                * out of xdr buffer space, and it is the only operation
-                * that behaves this way.)
+                * OP_LOCK and OP_LOCKT may return a conflicting lock.
+                * (Special case because it will just skip encoding this
+                * if it runs out of xdr buffer space, and it is the only
+                * operation that behaves this way.)
                 */
-               if (op->opnum == OP_LOCK)
+               if (op->opnum == OP_LOCK || op->opnum == OP_LOCKT)
                        max_reply += NFS4_OPAQUE_LIMIT;
 
                if (op->status) {