public inbox for linux-nfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Benny Halevy <bhalevy@panasas.com>
To: Trond Myklebust <Trond.Myklebust@netapp.com>,
	Andy Adamson <andros@netapp.com>
Cc: pnfs@linux-nfs.org, linux-nfs@vger.kernel.org
Subject: Re: [PATCH 1/2] nfs41: Move initialization of nfs4_opendata seq_res to nfs4_init_opendata_res
Date: Sun, 21 Jun 2009 18:06:45 +0300	[thread overview]
Message-ID: <4A3E4C85.7090302@panasas.com> (raw)
In-Reply-To: <1245523961.5182.6.camel-rJ7iovZKK19ZJLDQqaL3InhyD016LWXt@public.gmane.org>

On Jun. 20, 2009, 21:52 +0300, Trond Myklebust <Trond.Myklebust@netapp.com> wrote:
> On Thu, 2009-06-18 at 22:01 -0400, Benny Halevy wrote:
>> nfs4_open_recover_helper clears opendata->o_res
>> before calling nfs4_init_opendata_res, thus causing
>> NFSv4.0 OPEN operations to be sent rather than nfsv4.1.
>>
>> Signed-off-by: Benny Halevy <bhalevy@panasas.com>
>> ---
>> Trond, please add these two patches to the nfs41-for-2.6.31 series.
>> Also availble on git://linux-nfs.org/~bhalevy/linux-pnfs.git nfs41-for-2.6.31
>>
>>  fs/nfs/nfs4proc.c |    2 +-
>>  1 files changed, 1 insertions(+), 1 deletions(-)
>>
>> diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
>> index 57dabb8..04da834 100644
>> --- a/fs/nfs/nfs4proc.c
>> +++ b/fs/nfs/nfs4proc.c
>> @@ -680,6 +680,7 @@ static void nfs4_init_opendata_res(struct nfs4_opendata *p)
>>  	p->o_res.server = p->o_arg.server;
>>  	nfs_fattr_init(&p->f_attr);
>>  	nfs_fattr_init(&p->dir_attr);
>> +	p->o_res.seq_res.sr_slotid = NFS4_MAX_SLOT_TABLE;
> 
> This really needs cleaning up. The "magic sr_slotid value"
> initialisation is littering the code, and you have to look _very_
> carefully in order to figure out what NFS4_MAX_SLOT_TABLE actually
> means.
> 
> I'm applying this patch for now, but come 2.6.32, I do expect a
> changeset that gets rid of the sr_slotid magic value in favour of
> something that documents what it is for.

I agree that it is confusing.
I suggest that:
a. we add an helper to initialize struct nfs4_sequence_res
   so that the logic will be implemented in one place rather
   than scattered all over the place.
b. #define NFS4_INVALID_SLOT_ID NFS4_MAX_SLOT_TABLE
   and use as initial value.

Benny

> 
>>  }
>>  
>>  static struct nfs4_opendata *nfs4_opendata_alloc(struct path *path,
>> @@ -711,7 +712,6 @@ static struct nfs4_opendata *nfs4_opendata_alloc(struct path *path,
>>  	p->o_arg.server = server;
>>  	p->o_arg.bitmask = server->attr_bitmask;
>>  	p->o_arg.claim = NFS4_OPEN_CLAIM_NULL;
>> -	p->o_res.seq_res.sr_slotid = NFS4_MAX_SLOT_TABLE;
>>  	if (flags & O_EXCL) {
>>  		u32 *s = (u32 *) p->o_arg.u.verifier.data;
>>  		s[0] = jiffies;
> 

      parent reply	other threads:[~2009-06-21 15:06 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-19  2:01 [PATCH 1/2] nfs41: Move initialization of nfs4_opendata seq_res to nfs4_init_opendata_res Benny Halevy
2009-06-19  2:01 ` [PATCH 2/2] nfs41: sunrpc: xprt_alloc_bc_request() should not use spin_lock_bh() Benny Halevy
2009-06-20 18:52 ` [PATCH 1/2] nfs41: Move initialization of nfs4_opendata seq_res to nfs4_init_opendata_res Trond Myklebust
     [not found]   ` <1245523961.5182.6.camel-rJ7iovZKK19ZJLDQqaL3InhyD016LWXt@public.gmane.org>
2009-06-21 15:06     ` Benny Halevy [this message]

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=4A3E4C85.7090302@panasas.com \
    --to=bhalevy@panasas.com \
    --cc=Trond.Myklebust@netapp.com \
    --cc=andros@netapp.com \
    --cc=linux-nfs@vger.kernel.org \
    --cc=pnfs@linux-nfs.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