Linux NFS development
 help / color / mirror / Atom feed
* [PATCH 0/5] skip op encoders in error cases
@ 2017-07-14 20:24 J. Bruce Fields
  2017-07-14 20:24 ` [PATCH 1/5] nfsd4: move some nfsd4 op definitions to xdr4.h J. Bruce Fields
                   ` (4 more replies)
  0 siblings, 5 replies; 9+ messages in thread
From: J. Bruce Fields @ 2017-07-14 20:24 UTC (permalink / raw)
  To: linux-nfs; +Cc: J. Bruce Fields

From: "J. Bruce Fields" <bfields@redhat.com>

This is just some cleanup:

f961e3f2acae "nfsd: encoders mustn't use unitialized values in error
cases" fixed a couple cases like this:

	const struct nfsd4_layout_ops *ops =
                nfsd4_layout_ops[lgp->lg_layout_type];
        __be32 *p;

        dprintk("%s: err %d\n", __func__, nfserr);
        if (nfserr)
                goto out;

which ignored the fact that lg_layout_type isn't even initialized in
some error cases.

That seemed like an easy mistake to make, and made me wonder why we even
obther calling the xdr encoders in the error case, since almost all of
them are no-ops then.

So, these patches skip that.  I think it's an improvement, but I'll
listen to reason.

--b.

J. Bruce Fields (5):
  nfsd4: move some nfsd4 op definitions to xdr4.h
  opdesc will be useful outside nfs4proc.c
  nfsd4: define ->op_release for compound ops
  nfsd4: skip encoder in trivial error cases
  nfsd4: individual encoders no longer see error cases

 fs/nfsd/nfs4proc.c | 109 ++++++++----------
 fs/nfsd/nfs4xdr.c  | 322 ++++++++++++++++++-----------------------------------
 fs/nfsd/xdr4.h     |  49 ++++++++
 3 files changed, 208 insertions(+), 272 deletions(-)

-- 
2.9.4


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2017-07-17 18:44 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-07-14 20:24 [PATCH 0/5] skip op encoders in error cases J. Bruce Fields
2017-07-14 20:24 ` [PATCH 1/5] nfsd4: move some nfsd4 op definitions to xdr4.h J. Bruce Fields
2017-07-14 20:24 ` [PATCH 2/5] opdesc will be useful outside nfs4proc.c J. Bruce Fields
2017-07-14 20:24 ` [PATCH 3/5] nfsd4: define ->op_release for compound ops J. Bruce Fields
2017-07-15  9:27   ` kbuild test robot
2017-07-17 18:44     ` J. Bruce Fields
2017-07-15  9:30   ` kbuild test robot
2017-07-14 20:24 ` [PATCH 4/5] nfsd4: skip encoder in trivial error cases J. Bruce Fields
2017-07-14 20:24 ` [PATCH 5/5] nfsd4: individual encoders no longer see " J. Bruce Fields

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox