nfsd: fix nfsd4_encode_open buffer space reservation
authorBenny Halevy <bhalevy@panasas.com>
Tue, 12 Aug 2008 17:44:41 +0000 (20:44 +0300)
committerJ. Bruce Fields <bfields@citi.umich.edu>
Mon, 29 Sep 2008 21:56:58 +0000 (17:56 -0400)
nfsd4_encode_open first reservation is currently for 36 + sizeof(stateid_t)
while it writes after the stateid a cinfo (20 bytes) and 5 more 4-bytes
words, for a total of 40 + sizeof(stateid_t).

Signed-off-by: Benny Halevy <bhalevy@panasas.com>
Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
fs/nfsd/nfs4xdr.c

index d7e4bd50ed3c3ddfc2f04e39952ca2418069f82f..ace39349670a5eb22c1906f9ffb761e8b770e7b0 100644 (file)
@@ -2133,7 +2133,7 @@ nfsd4_encode_open(struct nfsd4_compoundres *resp, __be32 nfserr, struct nfsd4_op
        if (nfserr)
                goto out;
 
-       RESERVE_SPACE(36 + sizeof(stateid_t));
+       RESERVE_SPACE(40 + sizeof(stateid_t));
        WRITE32(open->op_stateid.si_generation);
        WRITEMEM(&open->op_stateid.si_opaque, sizeof(stateid_opaque_t));
        WRITECINFO(open->op_cinfo);