All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vitaliy Gusev <gusev.vitaliy@nexenta.com>
To: Andy Adamson <andros@netapp.com>
Cc: trond.myklebust@netapp.com, linux-nfs@vger.kernel.org
Subject: Re: [V2, 1/1] NFSv4.1: remove pnfs_layout_hdr from pnfs_destroy_all_layouts tmp_list
Date: Mon, 16 May 2011 23:39:54 +0400	[thread overview]
Message-ID: <4DD17D8A.8080605@nexenta.com> (raw)
In-Reply-To: <3CF6346D-446F-43A7-BAF7-9A365E7386E3@netapp.com>

On 05/16/2011 09:44 PM, Andy Adamson wrote:
>
> On May 14, 2011, at 6:50 PM, Vitaliy Gusev wrote:
>
>> On 01/-10/-28163 10:59 PM, Andy Adamson wrote:
>>> From: Andy Adamson<andros@netapp.com>
>>>
>>> Prevents an infinite loop as list was never emptied.
>>>
>>> Signed-off-by: Andy Adamson<andros@netapp.com>
>>> +++ b/fs/nfs/pnfs.c
>>> @@ -383,6 +383,7 @@ pnfs_destroy_all_layouts(struct nfs_client *clp)
>>>   				plh_layouts);
>>>   		dprintk("%s freeing layout for inode %lu\n", __func__,
>>>   			lo->plh_inode->i_ino);
>>> +		list_del_init(&lo->plh_layouts);
>>>   		pnfs_destroy_layout(NFS_I(lo->plh_inode));
>>
>> Shouldn't pnfs_destroy_layout() do it ?
>
> pnfs_destroy_layout can't do it. The list is local to pnfs_destroy_all_layouts.
> It's confusing because both pnfs_destroy_layout and pnfs_destroy_all_layouts have
 > a local tmp_list used for different purposes.

Yes purposes are different but "lo" is the same and list_del_init() in 
pnfs_free_lseg_list() see the same "lo" from pnfs_destroy_all_layouts.


  pnfs_destroy_layout(struct nfs_inode *nfsi):

       lo = nfsi->layout;

    >>> after that mark_matching_lsegs_invalid adds "lo" to tmplist_v2

	
  pnfs_free_lseg_list(tmplist_v2):

	lo = list_first_entry(free_me, struct pnfs_layout_segment,
			      pls_list)->pls_layout;

   ^^^^^^^^^^^^^^^^^^^^^^^^^^^
   Here is "lo" from pnfs_destroy_all_layouts.


	if (test_bit(NFS_LAYOUT_DESTROYED, &lo->plh_flags)) {
		struct nfs_client *clp;

		clp = NFS_SERVER(lo->plh_inode)->nfs_client;
		spin_lock(&clp->cl_lock);
		list_del_init(&lo->plh_layouts);
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   Here is second deleting "lo" that was already deleted in 
pnfs_destroy_all_layouts.

So if all is ok, it will delete list twice.

I suppose, either current schema has to be changed or list_del_init() 
should be removed from pnfs_destoy_all_layouts with fixing 
mark_matching_lsegs_invalid and ref counter.


---
Gusev Vitaliy

  reply	other threads:[~2011-05-16 19:52 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-11  5:19 [PATCH V2 1/1] NFSv4.1: remove pnfs_layout_hdr from pnfs_destroy_all_layouts tmp_list andros
2011-05-14 22:50 ` [V2, " Vitaliy Gusev
2011-05-16 17:44   ` Andy Adamson
2011-05-16 19:39     ` Vitaliy Gusev [this message]
2011-05-17 15:29       ` Andy Adamson

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=4DD17D8A.8080605@nexenta.com \
    --to=gusev.vitaliy@nexenta.com \
    --cc=andros@netapp.com \
    --cc=linux-nfs@vger.kernel.org \
    --cc=trond.myklebust@netapp.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.