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 12/16] SQUASHME pnfs-submit: reference layout across layoutcommit
Date: Tue, 13 Jul 2010 09:50:00 -0400	[thread overview]
Message-ID: <AANLkTinVZ3t5KMD-BAKFAhLTQ49eX06eA16psXKeDiXl@mail.gmail.com> (raw)
In-Reply-To: <4C3B5F26.1080100@panasas.com>

On Mon, Jul 12, 2010 at 2:29 PM, Benny Halevy <bhalevy@panasas.com> wro=
te:
> On Jul. 12, 2010, 21:27 +0300, "William A. (Andy) Adamson" <androsada=
mson@gmail.com> wrote:
>> On Mon, Jul 12, 2010 at 1:19 PM, Benny Halevy <bhalevy@panasas.com> =
wrote:
>>> On Jul. 08, 2010, 1:34 +0300, andros@netapp.com wrote:
>>>> From: Andy Adamson <andros@netapp.com>
>>>>
>>>> Signed-off-by: Andy Adamson <andros@netapp.com>
>>>> ---
>>>> =A0fs/nfs/nfs4proc.c | =A0 =A02 ++
>>>> =A0fs/nfs/pnfs.c =A0 =A0 | =A0 13 +++++++++++++
>>>> =A0fs/nfs/pnfs.h =A0 =A0 | =A0 =A01 +
>>>> =A03 files changed, 16 insertions(+), 0 deletions(-)
>>>>
>>>> diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
>>>> index 6acebc3..f763746 100644
>>>> --- a/fs/nfs/nfs4proc.c
>>>> +++ b/fs/nfs/nfs4proc.c
>>>> @@ -5565,6 +5565,8 @@ static void pnfs_layoutcommit_release(void *=
lcdata)
>>>> =A0 =A0 =A0 struct pnfs_layoutcommit_data *data =3D
>>>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 (struct pnfs_layoutcommit_data *)lcdat=
a;
>>>>
>>>> + =A0 =A0 /* Matched by get_layout in pnfs_layoutcommit_inode */
>>>> + =A0 =A0 put_layout(data->args.inode);
>>>> =A0 =A0 =A0 put_rpccred(data->cred);
>>>> =A0 =A0 =A0 pnfs_layoutcommit_free(lcdata);
>>>> =A0}
>>>> diff --git a/fs/nfs/pnfs.c b/fs/nfs/pnfs.c
>>>> index aa16e5d..d42c5da 100644
>>>> --- a/fs/nfs/pnfs.c
>>>> +++ b/fs/nfs/pnfs.c
>>>> @@ -354,6 +354,15 @@ put_layout_locked(struct pnfs_layout_type *lo=
)
>>>> =A0}
>>>>
>>>> =A0void
>>>> +put_layout(struct inode *inode)
>>>> +{
>>>> + =A0 =A0 spin_lock(&inode->i_lock);
>>>> + =A0 =A0 put_layout_locked(NFS_I(inode)->layout);
>>>> + =A0 =A0 spin_unlock(&inode->i_lock);
>>>> +
>>>> +}
>>>> +
>>>> +void
>>>> =A0pnfs_layout_release(struct pnfs_layout_type *lo,
>>>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 struct nfs4_pnfs_layout_segmen=
t *range)
>>>> =A0{
>>>> @@ -1598,6 +1607,9 @@ pnfs_layoutcommit_inode(struct inode *inode,=
 int sync)
>>>> =A0 =A0 =A0 __clear_bit(NFS_INO_LAYOUTCOMMIT, &nfsi->layout->pnfs_=
layout_state);
>>>> =A0 =A0 =A0 pnfs_get_layout_stateid(&data->args.stateid, nfsi->lay=
out);
>>>>
>>>> + =A0 =A0 /* Reference for layoutcommit matched in pnfs_layoutcomm=
it_release */
>>>> + =A0 =A0 get_layout(NFS_I(inode)->layout);
>>>> +
>>>
>>> So from the 30000 foot level, I need to remind myself what do
>>> we need the refcount on the layout hdr (pnfs_layout_type) for?
>>
>>> Can we really use it detached from the inode? NO
>>> Is it only for debugging to make catch the case that the inode
>>> is released while there are references to the layout?
>>
>> When we migrate the filesystem, we need to reap the nfs_inode->layou=
t
>> while keeping the nfs_inode.
>>
>
> But how does the refcount help us with that?
> Don't we have to do this synchronously before reusing the nfs_inode?

We need to drain all slots which could have async LAYOUTCOMMITs or
async LAYOUTRETURNs still on the wire.  The refcount keeps the
nfs_inode->layout allocated for the LAYOUTCOMMIT return.


-->Andy

>
> Benny
>
>> Same with server reboot, network partition, and use of a different r=
eplica.
>>
>> -->Andy
>>
>>>
>>> Benny
>>>
>>>> =A0 =A0 =A0 spin_unlock(&inode->i_lock);
>>>>
>>>> =A0 =A0 =A0 /* Set up layout commit args */
>>>> @@ -1606,6 +1618,7 @@ pnfs_layoutcommit_inode(struct inode *inode,=
 int sync)
>>>> =A0 =A0 =A0 if (status) {
>>>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 /* The layout driver failed to setup t=
he layoutcommit */
>>>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 put_rpccred(data->cred);
>>>> + =A0 =A0 =A0 =A0 =A0 =A0 put_layout(inode);
>>>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 goto out_free;
>>>> =A0 =A0 =A0 }
>>>> =A0 =A0 =A0 status =3D pnfs4_proc_layoutcommit(data, sync);
>>>> diff --git a/fs/nfs/pnfs.h b/fs/nfs/pnfs.h
>>>> index 9b0fed4..e04b9d4 100644
>>>> --- a/fs/nfs/pnfs.h
>>>> +++ b/fs/nfs/pnfs.h
>>>> @@ -64,6 +64,7 @@ void pnfs_layout_release(struct pnfs_layout_type=
 *, struct nfs4_pnfs_layout_segm
>>>> =A0void pnfs_set_layout_stateid(struct pnfs_layout_type *lo,
>>>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0const nfs4_=
stateid *stateid);
>>>> =A0void pnfs_destroy_layout(struct nfs_inode *);
>>>> +void put_layout(struct inode *inode);
>>>>
>>>> =A0#define PNFS_EXISTS_LDIO_OP(srv, opname) ((srv)->pnfs_curr_ld &=
& =A0 =A0 \
>>>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=
 =A0(srv)->pnfs_curr_ld->ld_io_ops && =A0\
>>>
>>> --
>>> 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 =A0http://vger.kernel.org/majordomo-info.htm=
l
>>>
>

  reply	other threads:[~2010-07-13 13:50 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-07 22:34 [PATCH 0/16] pnfs-submit fix layout allocation and reference counting andros
2010-07-07 22:34 ` [PATCH 01/16] SQUASHME pnfs-submit: add state flag for layoutcommit_needed andros
2010-07-07 22:34   ` [PATCH 02/16] SQUASHME: pnfs-submit: move pnfs_layout_suspend back to nfs_inode andros
2010-07-07 22:34     ` [PATCH 03/16] SQUASHME pnfs-submit embed pnfs_layout_type andros
2010-07-07 22:34       ` [PATCH 04/16] SQUASHME pnfs-submit: filelayout: use new alloc/free_layout API andros
2010-07-07 22:34         ` [PATCH 05/16] SQUASHME pnfs-submit: rewrite layout allocation andros
2010-07-07 22:34           ` [PATCH 06/16] SQUASHME pnfs-submit; fix pnfs_update_layout reference counting andros
2010-07-07 22:34             ` [PATCH 07/16] SQUASHME pnfs_submit: don't get a reference on boundary calculation andros
2010-07-07 22:34               ` [PATCH 08/16] SQUASHME pnfs-submit: don't reference the layout in init_lseg andros
2010-07-07 22:34                 ` [PATCH 09/16] SQUASHME pnfs-submit: pnfs_update_layout always references the lseg andros
2010-07-07 22:34                   ` [PATCH 10/16] SQUASHME pnfs-submit: reference the layout when inserted into segs list andros
2010-07-07 22:34                     ` [PATCH 11/16] SQUASHME pnfs-submit: rename put_layout to put_layout_locked andros
2010-07-07 22:34                       ` [PATCH 12/16] SQUASHME pnfs-submit: reference layout across layoutcommit andros
2010-07-07 22:34                         ` [PATCH 13/16] SQUASHME pnfs-submit: reference layout for layoutreturn andros
2010-07-07 22:34                           ` [PATCH 14/16] SQUASHME pnfs-submit: remove put_layout from pnfs_free_layout andros
2010-07-07 22:34                             ` [PATCH 15/16] SQUASHME pnfs-submit: do not reference a layout in destroy_layout andros
2010-07-07 22:34                               ` [PATCH 16/16] SQUASHME pnfs-submit: remove grab_current_layout andros
2010-07-12 17:19                         ` [PATCH 12/16] SQUASHME pnfs-submit: reference layout across layoutcommit Benny Halevy
2010-07-12 18:27                           ` William A. (Andy) Adamson
     [not found]                             ` <AANLkTil1wUQUTht0QP7_Ttaagw0-LXef2J8wU6wSFUWG-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-07-12 18:29                               ` Benny Halevy
2010-07-13 13:50                                 ` William A. (Andy) Adamson [this message]
2010-07-12 17:25                         ` Boaz Harrosh
2010-07-12 18:09                           ` William A. (Andy) Adamson
     [not found]                             ` <AANLkTilWfV86wpO7vFho3FmL9y9Y6Sx9_-knKq7T-snu-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-07-12 18:27                               ` Benny Halevy
2010-07-12 18:28                                 ` William A. (Andy) Adamson
     [not found]                                   ` <AANLkTilrcKirEQLe5mhtYNAnaJBSn6q4edC3TlXJd1rm-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-07-12 19:54                                     ` Benny Halevy
2010-07-12  9:13                   ` [PATCH 09/16] SQUASHME pnfs-submit: pnfs_update_layout always references the lseg Benny Halevy
2010-07-12  8:30           ` [PATCH 05/16] SQUASHME pnfs-submit: rewrite layout allocation Benny Halevy
2010-07-13 13:39             ` William A. (Andy) Adamson
     [not found]               ` <AANLkTilb6ePL7s6H4TbhGfJt05Yw7Gc24V0C8cPHC22K-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-07-13 14:04                 ` Benny Halevy
2010-07-12 16:32         ` [PATCH 04/16] SQUASHME pnfs-submit: filelayout: use new alloc/free_layout API Boaz Harrosh
2010-07-12 16:29       ` [PATCH 03/16] SQUASHME pnfs-submit embed pnfs_layout_type Boaz Harrosh
2010-07-12 17:05         ` Benny Halevy
2010-07-12 17:38           ` William A. (Andy) Adamson
2010-07-12 17:34         ` William A. (Andy) Adamson
     [not found]           ` <AANLkTikTMLQJwj1PeW2Y0dfmRcVFdNr6sasxJtaAiMg4-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-07-12 17:43             ` Boaz Harrosh
2010-07-12 18:33               ` William A. (Andy) Adamson
2010-07-07 22:57 ` [PATCH 0/16] pnfs-submit fix layout allocation and reference counting Gilliam, PaulX J
2010-07-08 10:16 ` Boaz Harrosh
2010-07-08 16:14   ` William A. (Andy) Adamson
2010-07-12 15:33     ` Boaz Harrosh

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=AANLkTinVZ3t5KMD-BAKFAhLTQ49eX06eA16psXKeDiXl@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).