linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "William A. (Andy) Adamson" <androsadamson@gmail.com>
To: Benny Halevy <bhalevy@panasas.com>
Cc: linux-nfs@vger.kernel.org
Subject: Re: [PATCH 1/3] pnfs_submit: move layout segment valid test
Date: Thu, 7 Oct 2010 15:28:53 -0400	[thread overview]
Message-ID: <AANLkTi==KuNTW0yPsupb4p20+qTaD3vpOux9wF4Ekd8g@mail.gmail.com> (raw)
In-Reply-To: <4CAE16FA.9040606@panasas.com>

On Thu, Oct 7, 2010 at 2:52 PM, Benny Halevy <bhalevy@panasas.com> wrote:
> On 2010-10-07 15:37, andros@netapp.com wrote:
>> From: Andy Adamson <andros@rhel6-1.androsmac.org>
>>
>> Do not get_lseg for a non-valid lseg.
>> Prepare for calling put_lseg outside of inode i_lock.
>>
>> Signed-off-by: Andy Adamson <andros@netapp.com>
>> ---
>>  fs/nfs/pnfs.c |    4 ++--
>>  1 files changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/fs/nfs/pnfs.c b/fs/nfs/pnfs.c
>> index 6b2a95d..24620cf 100644
>> --- a/fs/nfs/pnfs.c
>> +++ b/fs/nfs/pnfs.c
>> @@ -845,7 +845,8 @@ pnfs_has_layout(struct pnfs_layout_hdr *lo,
>>       list_for_each_entry(lseg, &lo->segs, fi_list) {
>>               if (is_matching_lseg(lseg, range)) {
>>                       ret = lseg;
>> -                     get_lseg(ret);
>> +                     if (lseg->valid)
>> +                             get_lseg(ret);
>
> We shouldn't be hiding this inside pnfs_has_layout
> and have different side effects in the different cases.

Sorry - I just looked at the pnfs-submit branch. I should have looked
at the pnfs-all branch and seen the other callers of pnfs_has_layout.

> Since we're called under the lock, pnfs_has_layout
> can just return the lseg and never get a reference and its
> caller can take it if necessary before releasing the lock.
>
> Also, it doesn't need to be EXPORT_SYMBOL_GPLed as it's
> not used outside of the nfs client module.

Right - Fred just removed the call in the file layout driver.

I'll fix this.

-->Andy

>
> Benny
>
>>                       break;
>>               }
>>               if (cmp_layout(range, &lseg->range) > 0)
>> @@ -889,7 +890,6 @@ pnfs_update_layout(struct inode *ino,
>>       /* Check to see if the layout for the given range already exists */
>>       lseg = pnfs_has_layout(lo, &arg);
>>       if (lseg && !lseg->valid) {
>> -             put_lseg_locked(lseg);
>>               /* someone is cleaning the layout */
>>               lseg = NULL;
>>               goto out_unlock;
> --
> To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>

  parent reply	other threads:[~2010-10-07 19:28 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-07 19:37 [PATCH 1/3] pnfs_submit: move layout segment valid test andros
2010-10-07 18:52 ` Benny Halevy
2010-10-07 19:17   ` [PATCH 1/1] SQUASHME: pnfs-submit: do not get_lseg in pnfs_has_layout Benny Halevy
2010-10-07 19:17   ` [PATCH 2/2] SQUASHME: pnfs: get_lseg in nfs4_layoutget_prepare rather than " Benny Halevy
2010-10-07 19:28   ` William A. (Andy) Adamson [this message]
2010-10-07 19:37 ` [PATCH 2/3] pnfs_submit: fix deadlock in pnfs_clear_lseg_list andros
2010-10-07 19:37   ` [PATCH 3/3] pnfs_submit: enforce requested DS only pNFS role andros
2010-10-07 17:06     ` Benny Halevy
2010-10-07 18:08       ` Benny Halevy
2010-10-07 18:41         ` Benny Halevy
2010-10-07 19:23           ` Benny Halevy
2010-10-07 18:10       ` Fred Isaman
2010-10-07 18:12         ` Fred Isaman

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='AANLkTi==KuNTW0yPsupb4p20+qTaD3vpOux9wF4Ekd8g@mail.gmail.com' \
    --to=androsadamson@gmail.com \
    --cc=bhalevy@panasas.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;
as well as URLs for NNTP newsgroup(s).