From: Boaz Harrosh <bharrosh@panasas.com>
To: "William A. (Andy) Adamson" <androsadamson@gmail.com>
Cc: Tao Guo <glorioustao@gmail.com>,
bhalevy@panasas.com, linux-nfs@vger.kernel.org
Subject: Re: [PATCH 1/1] SQUASHME pnfs-submit: replace layoutcommit_ctx with rpc_cred
Date: Mon, 24 May 2010 21:20:55 +0300 [thread overview]
Message-ID: <4BFAC387.6010202@panasas.com> (raw)
In-Reply-To: <AANLkTikCKm-ogV0byN2LSxAoYVFWPujpF3iKe7qlOTIY-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
On 05/24/2010 08:25 PM, William A. (Andy) Adamson wrote:
> On Mon, May 24, 2010 at 12:02 PM, Tao Guo <glorioustao@gmail.com> wrote:
>> On Mon, May 24, 2010 at 9:43 PM, William A. (Andy) Adamson
>> <androsadamson@gmail.com> wrote:
>>> On Mon, May 24, 2010 at 2:37 AM, Tao Guo <glorioustao@gmail.com> wrote:
>>>> I see... But what if sync == 1? At that time, data must have already
>>>> been freed, so you should not use data->cred anymore.
>>>
>>> Agreed.
>>>
>>> Since LAYOUTCOMMIT is not called after close, we can get rid of taking
>>> the reference all together since a reference is taken on OPEN and
>>> dropped on CLOSE.
>
> I forgot memory mapped files where writes can occur after the close,
> and so layoutcommit can also occur after the close. So, I will keep
> the get_rpccred in pnfs_need_layout commit and resend this patch with
> the put_rpccred in the layoutcommit done routine.
>
Andy I get hangs on:
data->is_sync = sync;
status = pnfs4_proc_layoutcommit(data);
+ put_rpccred(data->cred);
with sync==1 like Tao Guo said
could you send the updated patch?
Boaz
>>>
>>> -->Andy
>> I agree. However that will change several functions' interface I guess.
>>
>> I still have a question: why some procedures need to set rpc_cred
>> whereas some needn't ? what is the connection between ctx's rpc_cred
>> and nfs4_state_owner's so_cred? Any guidance will be appreciated...
>
> Here's my take on an answer...
>
> If an rpc_cred is not specified in the rpc_msg then the fsuid, fsgid,
> and group info toe the current_cred is used to lookup an rpc_cred.
> RPC's can be sent from several tasks - rpciod vrs the application task
> for example. OPEN, CLOSE, LOCK, UNLOCK, READ, WRITE (and memmapped
> I/O) should all be sent with the credential that opened the file. So,
> in order to ensure this the nfs4_state_owner->so_cred is used for
> these compounds even if the task is rpciod with root fsuid/fsgid. The
> nfs_open_context rpc_cred is the nfs4_state_owner so_cred. The
> nfs_open_context can exist longer than the nfs4_state_owner.
>
> I think LAYOUTCOMMIT also wants to use the credential that did the I/O
> - not for the file layout driver which doesn't care, but for the
> object and block layout drivers that use the layout as a lock and
> where a permissions check (?) is done on LAYOUTCOMMIT.
>
> Currently, LAYOUTGET and LAYOUTRETURN don't set the rpc_cred. This is
> because the layout can last past opens and closes. If we ever want to
> support EXCHGID4_FLAG_BIND_PRINC_STATEID we will need to remember the
> cred and set it for these calls.
>
> -->Andy
>
>
>
>>
>>>>
>>>> --
>>>> tao.
>>>>
>>>
>>
>>
>>
>> --
>> tao.
>>
> --
> 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
>
next prev parent reply other threads:[~2010-05-24 18:20 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-05-20 16:04 [PATCH 1/1] SQUASHME pnfs-submit: replace layoutcommit_ctx with rpc_cred andros
2010-05-21 2:50 ` Tao Guo
[not found] ` <AANLkTinRG_AhVwFZ6a3GllIHSLa3zBDl0zmVDp3btJhn-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-05-21 12:47 ` William A. (Andy) Adamson
[not found] ` <AANLkTikCPFKKMWFVCT3AlIz792q12x3QrH3vDVVePPXN-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-05-24 6:37 ` Tao Guo
2010-05-24 13:43 ` William A. (Andy) Adamson
[not found] ` <AANLkTikvP2aetI4bF-3ebus1Y91qFV4ahCXfxR_5ZNBN-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-05-24 16:02 ` Tao Guo
[not found] ` <AANLkTik-l_9nhBGWv-C8FKz9Aq99uP7-AWSi_uB4YDBG-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-05-24 17:25 ` William A. (Andy) Adamson
[not found] ` <AANLkTikCKm-ogV0byN2LSxAoYVFWPujpF3iKe7qlOTIY-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-05-24 18:20 ` Boaz Harrosh [this message]
2010-05-24 18:22 ` Andy Adamson
-- strict thread matches above, loose matches on Subject: below --
2010-05-24 18:28 [PATCH 0/1] " andros
2010-05-24 18:28 ` [PATCH 1/1] SQUASHME pnfs-submit: " andros
2010-05-24 18:51 ` Boaz Harrosh
2010-05-25 4:07 ` Benny Halevy
2010-05-25 6:56 ` Benny Halevy
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=4BFAC387.6010202@panasas.com \
--to=bharrosh@panasas.com \
--cc=androsadamson@gmail.com \
--cc=bhalevy@panasas.com \
--cc=glorioustao@gmail.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 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.