Linux NFS development
 help / color / mirror / Atom feed
From: Chuck Lever <chuck.lever@oracle.com>
To: Trond Myklebust <trond.myklebust@primarydata.com>
Cc: Linux NFS Mailing List <linux-nfs@vger.kernel.org>
Subject: Re: [PATCH 1/3] NFSv4: Fix a slot leak in nfs40_sequence_done
Date: Thu, 30 Jan 2014 09:02:17 -0800	[thread overview]
Message-ID: <1F18AF43-7FE7-482A-B022-3895880A435B@oracle.com> (raw)
In-Reply-To: <2DA614A7-AE5A-47DA-AAB3-79D480540B5E@primarydata.com>


On Jan 30, 2014, at 8:55 AM, Trond Myklebust <trond.myklebust@primarydata.com> wrote:

> 
> On Jan 30, 2014, at 11:49, Chuck Lever <chuck.lever@oracle.com> wrote:
> 
>> 
>> On Jan 29, 2014, at 9:36 AM, Trond Myklebust <trond.myklebust@primarydata.com> wrote:
>> 
>>> The check for whether or not we sent an RPC call in nfs40_sequence_done
>>> is insufficient to decide whether or not we are holding a session slot,
>>> and thus should not be used to decide when to free that slot.
>>> 
>>> This patch replaces the RPC_WAS_SENT() test with the correct test for
>>> whether or not slot == NULL.
>>> 
>>> Cc: Chuck Lever <chuck.lever@oracle.com>
>>> Cc: stable@vger.kernel.org # 3.12+
>>> Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
>>> ---
>>> fs/nfs/nfs4proc.c | 2 +-
>>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>> 
>>> diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
>>> index ae00c3ed733f..493e9cce1f11 100644
>>> --- a/fs/nfs/nfs4proc.c
>>> +++ b/fs/nfs/nfs4proc.c
>>> @@ -539,7 +539,7 @@ static int nfs40_sequence_done(struct rpc_task *task,
>>> 	struct nfs4_slot *slot = res->sr_slot;
>>> 	struct nfs4_slot_table *tbl;
>>> 
>>> -	if (!RPC_WAS_SENT(task))
>>> +	if (slot == NULL)
>>> 		goto out;
>> 
>> When CONFIG_NFS_V4_1 is enabled, nfs4_sequence_done() already does the slot == NULL test, though the other nfs40_sequence_done() call sites do not.  This patch should clean that up?
> 
> Unfortunately we can’t touch nfs4_sequence_done: it wants to test for whether or not a NFSv4.1 session exists, which requires it to look at slot->table->session. :-(

Move the slot == NULL check to all nfs40_sequence_done() call sites?  <shrug>

If not, can we get a code comment that explains why that check is done twice in the common path?

--
Chuck Lever
chuck[dot]lever[at]oracle[dot]com




  reply	other threads:[~2014-01-30 17:02 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-29 17:36 [PATCH 1/3] NFSv4: Fix a slot leak in nfs40_sequence_done Trond Myklebust
2014-01-29 17:36 ` [PATCH 2/3] NFSv4.1: Clean up nfs41_sequence_done Trond Myklebust
2014-01-29 17:36   ` [PATCH 3/3] NFSv4.1: Cleanup Trond Myklebust
2014-01-30 16:49 ` [PATCH 1/3] NFSv4: Fix a slot leak in nfs40_sequence_done Chuck Lever
2014-01-30 16:55   ` Trond Myklebust
2014-01-30 17:02     ` Chuck Lever [this message]
2014-01-30 17:03       ` Trond Myklebust
2014-01-30 17:06         ` Trond Myklebust

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=1F18AF43-7FE7-482A-B022-3895880A435B@oracle.com \
    --to=chuck.lever@oracle.com \
    --cc=linux-nfs@vger.kernel.org \
    --cc=trond.myklebust@primarydata.com \
    /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