[pnfs] [PATCH 04/23] 2.6-latest pnfs client no lease update in nfs41_sequence_done for ds
Benny Halevy
bhalevy at panasas.com
Fri Dec 28 01:39:43 EST 2007
On Dec. 27, 2007, 23:22 +0200, "William A. (Andy) Adamson" <andros at citi.umich.edu> wrote:
> On 12/23/07, Benny Halevy <bhalevy at panasas.com> wrote:
>> On Dec. 13, 2007, 22:51 +0200, andros at umich.edu wrote:
>> <snip>
>>> From: Andy Adamson <andros at umich.edu>
>>>
>>> Allow a NULL nfs_client parameter to nfs41_sequence_done.
>>>
>>> The data server has no lease to update. There is no way to reference the
>>> data server's struct nfs_client because we don't keep one.
>>>
>>> The use of struct nfs_client for data server session creation will
>>> will probably be replaced with a structure with only relevant fields.
>>>
>>> Signed-off by: Andy Adamson<andros at umich.edu>
>>> ---
>>> fs/nfs/nfs4proc.c | 10 +++++++---
>>> 1 files changed, 7 insertions(+), 3 deletions(-)
>>>
>>> diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
>>> index 0185cae..594dabc 100644
>>> --- a/fs/nfs/nfs4proc.c
>>> +++ b/fs/nfs/nfs4proc.c
>>> @@ -248,6 +248,10 @@ int nfs4_wait_bit_interruptible(void *word)
>>> }
>>>
>>> #ifdef CONFIG_NFS_V4_1
>>> +/* For pNFS filelayout data servers:
>>> + * the nfs_client is NULL - to signal no lease update.
>>> + * session is the data server.
>>> + */
>>> static int nfs41_sequence_done(struct nfs_client *clp,
>>> struct nfs4_session *session,
>>> struct nfs41_sequence_res *res, int status)
>>> @@ -256,8 +260,6 @@ static int nfs41_sequence_done(struct nfs_client
>> *clp,
>>> struct nfs4_slot_table *tbl;
>>> struct nfs4_slot *slot;
>>>
>>> - BUG_ON(clp == NULL);
>>> -
>> I want to submit this patch to the nfs41 branch so how about
>> putting this bug on inside #if !defined(CONFIG_PNFS) rather than
>> deleting it?
>
> Benny
>>> tbl = &session->fore_channel.slot_table;
>>> slot = res->sr_slot;
>>>
>>> @@ -280,6 +282,8 @@ static int nfs41_sequence_done(struct nfs_client
>> *clp,
>>> * The sequence call was successful,
>>> * Update our lease renewal timers
>>> */
>>> + if (!clp)
>>> + goto no_update;
>
>
>
> ok - but the use and declaration of no_update should also be in the
> !defined(CONFIG_PNFS). perhaps we should get rid of the goto to reduce the
> #ifdef's...
hmm, I think they can stay for the CONFIG_PNFS case even without ifdef
protection although it's never supposed to be executed after the BUG_ON.
Anyhow, I'll see if this can be cleaned up.
>
>
>> timestamp = res->sr_renewal_time;
>>> spin_lock(&clp->cl_lock);
>>> @@ -287,7 +291,7 @@ static int nfs41_sequence_done(struct nfs_client
>> *clp,
>>> clp->cl_last_renewal = timestamp;
>>> spin_unlock(&clp->cl_lock);
>>> }
>>> -
>>> +no_update:
>>> /* Clear the 'busy' bit on the slot that was used */
>>> smp_mb__before_clear_bit();
>>> clear_bit(NFS4_SLOT_BUSY, &slot->flags);
>> _______________________________________________
>> pNFS mailing list
>> pNFS at linux-nfs.org
>> http://linux-nfs.org/cgi-bin/mailman/listinfo/pnfs
>>
>>
>
More information about the pNFS
mailing list