nfsd4: skip encoder in trivial error cases
authorJ. Bruce Fields <bfields@redhat.com>
Sat, 6 May 2017 14:49:21 +0000 (10:49 -0400)
committerJ. Bruce Fields <bfields@redhat.com>
Fri, 25 Aug 2017 02:12:48 +0000 (22:12 -0400)
commitb7571e4cd39ae860379138b883bc5f57a8553184
tree331f475565a52362b1b1d83d89edd305f723fcf2
parent34b1744c91ccd44811005822106945fa80ecbff2
nfsd4: skip encoder in trivial error cases

Most encoders do nothing in the error case.  But they can still screw
things up in that case: most errors happen very early in rpc processing,
possibly before argument fields are filled in and bounds-tested, so
encoders that do anything other than immediately bail on error can
easily crash in odd error cases.

So just handle errors centrally most of the time to remove the chance of
error.

Signed-off-by: J. Bruce Fields <bfields@redhat.com>
fs/nfsd/nfs4proc.c
fs/nfsd/nfs4xdr.c
fs/nfsd/xdr4.h