]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
nfsd4: fix test_stateid error reply encoding
authorJ. Bruce Fields <bfields@redhat.com>
Mon, 3 Feb 2014 21:31:42 +0000 (16:31 -0500)
committerJiri Slaby <jslaby@suse.cz>
Thu, 15 May 2014 07:55:06 +0000 (09:55 +0200)
commit a11fcce1544df08c723d950ff0edef3adac40405 upstream.

If the entire operation fails then there's nothing to encode.

Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
fs/nfsd/nfs4xdr.c

index 0407ba4990e07f29c95be887f1039cb219012f19..4ab5ff492ca1626e13303fcd574b753f6cbe7583 100644 (file)
@@ -3512,6 +3512,9 @@ nfsd4_encode_test_stateid(struct nfsd4_compoundres *resp, __be32 nfserr,
        struct nfsd4_test_stateid_id *stateid, *next;
        __be32 *p;
 
+       if (nfserr)
+               return nfserr;
+
        RESERVE_SPACE(4 + (4 * test_stateid->ts_num_ids));
        *p++ = htonl(test_stateid->ts_num_ids);