Linux NFS development
 help / color / mirror / Atom feed
From: "J. Bruce Fields" <bfields@redhat.com>
To: linux-nfs@vger.kernel.org
Cc: "J. Bruce Fields" <bfields@redhat.com>
Subject: [PATCH 0/5] skip op encoders in error cases
Date: Fri, 14 Jul 2017 16:24:50 -0400	[thread overview]
Message-ID: <1500063895-29457-1-git-send-email-bfields@redhat.com> (raw)

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


             reply	other threads:[~2017-07-14 20:25 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-14 20:24 J. Bruce Fields [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1500063895-29457-1-git-send-email-bfields@redhat.com \
    --to=bfields@redhat.com \
    --cc=linux-nfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox