All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] knfsd: set the response bitmask for NFS4_CREATE_EXCLUSIVE (repost)
@ 2007-06-27 13:29 Jeff Layton
  2007-06-27 21:26 ` Neil Brown
  0 siblings, 1 reply; 7+ messages in thread
From: Jeff Layton @ 2007-06-27 13:29 UTC (permalink / raw)
  To: neilb; +Cc: nfs, nfsv4

Haven't seen any comments on this patch so far. Neil, any thoughts?

--------------[snip]--------------

RFC 3530 says:

 If the server uses an attribute to store the exclusive
 create verifier, it will signify which attribute by setting the
 appropriate bit in the attribute mask that is returned in the
 results.

Linux uses the atime and mtime to store the verifier, but sends a zeroed out
bitmask back to the client. This patch makes sure that we set the correct
bits in the bitmask in this situation.

Signed-off-by: Jeff Layton <jlayton@redhat.com>

diff --git a/fs/nfsd/nfs4proc.c b/fs/nfsd/nfs4proc.c
index 8522729..da20674 100644
--- a/fs/nfsd/nfs4proc.c
+++ b/fs/nfsd/nfs4proc.c
@@ -99,7 +99,15 @@ do_open_lookup(struct svc_rqst *rqstp, struct svc_fh *current_fh, struct nfsd4_o
 		status = nfsd_create_v3(rqstp, current_fh, open->op_fname.data,
 					open->op_fname.len, &open->op_iattr,
 					&resfh, open->op_createmode,
-					(u32 *)open->op_verf.data, &open->op_truncate, &created);
+					(u32 *)open->op_verf.data,
+					&open->op_truncate, &created);
+
+		/* If we ever decide to use different attrs to store the
+		 * verifier in nfsd_create_v3, then we'll need to change this
+		 */
+		if (open->op_createmode == NFS4_CREATE_EXCLUSIVE && status == 0)
+			open->op_bmval[1] |= (FATTR4_WORD1_TIME_ACCESS |
+						FATTR4_WORD1_TIME_MODIFY);
 	} else {
 		status = nfsd_lookup(rqstp, current_fh,
 				     open->op_fname.data, open->op_fname.len, &resfh);

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
NFS maillist  -  NFS@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nfs

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH] knfsd: set the response bitmask for NFS4_CREATE_EXCLUSIVE (repost)
  2007-06-27 13:29 [PATCH] knfsd: set the response bitmask for NFS4_CREATE_EXCLUSIVE (repost) Jeff Layton
@ 2007-06-27 21:26 ` Neil Brown
  2007-06-27 21:28   ` J. Bruce Fields
  2007-06-27 21:39   ` Jeff Layton
  0 siblings, 2 replies; 7+ messages in thread
From: Neil Brown @ 2007-06-27 21:26 UTC (permalink / raw)
  To: Jeff Layton; +Cc: J. Bruce Fields, nfs, nfsv4

On Wednesday June 27, jlayton@redhat.com wrote:
> Haven't seen any comments on this patch so far. Neil, any thoughts?

I don't remember seeing it before, but that doesn't say much...
My thoughts:
 1/ I would like it to come to me through Bruce.
 2/ The comment is good, but seems to be asking for a matching comment
    in nfsd_create_v3.

NeilBrown

> 
> --------------[snip]--------------
> 
> RFC 3530 says:
> 
>  If the server uses an attribute to store the exclusive
>  create verifier, it will signify which attribute by setting the
>  appropriate bit in the attribute mask that is returned in the
>  results.
> 
> Linux uses the atime and mtime to store the verifier, but sends a zeroed out
> bitmask back to the client. This patch makes sure that we set the correct
> bits in the bitmask in this situation.
> 
> Signed-off-by: Jeff Layton <jlayton@redhat.com>
> 
> diff --git a/fs/nfsd/nfs4proc.c b/fs/nfsd/nfs4proc.c
> index 8522729..da20674 100644
> --- a/fs/nfsd/nfs4proc.c
> +++ b/fs/nfsd/nfs4proc.c
> @@ -99,7 +99,15 @@ do_open_lookup(struct svc_rqst *rqstp, struct svc_fh *current_fh, struct nfsd4_o
>  		status = nfsd_create_v3(rqstp, current_fh, open->op_fname.data,
>  					open->op_fname.len, &open->op_iattr,
>  					&resfh, open->op_createmode,
> -					(u32 *)open->op_verf.data, &open->op_truncate, &created);
> +					(u32 *)open->op_verf.data,
> +					&open->op_truncate, &created);
> +
> +		/* If we ever decide to use different attrs to store the
> +		 * verifier in nfsd_create_v3, then we'll need to change this
> +		 */
> +		if (open->op_createmode == NFS4_CREATE_EXCLUSIVE && status == 0)
> +			open->op_bmval[1] |= (FATTR4_WORD1_TIME_ACCESS |
> +						FATTR4_WORD1_TIME_MODIFY);
>  	} else {
>  		status = nfsd_lookup(rqstp, current_fh,
>  				     open->op_fname.data, open->op_fname.len, &resfh);

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
NFS maillist  -  NFS@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nfs

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] knfsd: set the response bitmask for NFS4_CREATE_EXCLUSIVE (repost)
  2007-06-27 21:26 ` Neil Brown
@ 2007-06-27 21:28   ` J. Bruce Fields
  2007-06-28  1:30     ` Jeff Layton
  2007-06-27 21:39   ` Jeff Layton
  1 sibling, 1 reply; 7+ messages in thread
From: J. Bruce Fields @ 2007-06-27 21:28 UTC (permalink / raw)
  To: Neil Brown; +Cc: nfs, nfsv4, Jeff Layton

On Thu, Jun 28, 2007 at 07:26:45AM +1000, Neil Brown wrote:
> On Wednesday June 27, jlayton@redhat.com wrote:
> > Haven't seen any comments on this patch so far. Neil, any thoughts?
> 
> I don't remember seeing it before, but that doesn't say much...
> My thoughts:
>  1/ I would like it to come to me through Bruce.

Sorry, should have picked it up before.  I'm at OLS right now, and a
litlte slower than usual; I'll get to it.--b.

>  2/ The comment is good, but seems to be asking for a matching comment
>     in nfsd_create_v3.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] knfsd: set the response bitmask for NFS4_CREATE_EXCLUSIVE (repost)
  2007-06-27 21:26 ` Neil Brown
  2007-06-27 21:28   ` J. Bruce Fields
@ 2007-06-27 21:39   ` Jeff Layton
  1 sibling, 0 replies; 7+ messages in thread
From: Jeff Layton @ 2007-06-27 21:39 UTC (permalink / raw)
  To: Neil Brown; +Cc: J. Bruce Fields, nfsv4, nfs

On Thu, 28 Jun 2007 07:26:45 +1000
Neil Brown <neilb@suse.de> wrote:

> On Wednesday June 27, jlayton@redhat.com wrote:
> > Haven't seen any comments on this patch so far. Neil, any thoughts?
> 
> I don't remember seeing it before, but that doesn't say much...
> My thoughts:
>  1/ I would like it to come to me through Bruce.

Ahh, I'll make a mental note to badger Bruce in the future ;-)

>  2/ The comment is good, but seems to be asking for a matching comment
>     in nfsd_create_v3.
> 

Good point, let me add a comment there. I'll respin the patch and
resend.

> NeilBrown
> 
> > 
> > --------------[snip]--------------
> > 
> > RFC 3530 says:
> > 
> >  If the server uses an attribute to store the exclusive
> >  create verifier, it will signify which attribute by setting the
> >  appropriate bit in the attribute mask that is returned in the
> >  results.
> > 
> > Linux uses the atime and mtime to store the verifier, but sends a zeroed out
> > bitmask back to the client. This patch makes sure that we set the correct
> > bits in the bitmask in this situation.
> > 
> > Signed-off-by: Jeff Layton <jlayton@redhat.com>
> > 
> > diff --git a/fs/nfsd/nfs4proc.c b/fs/nfsd/nfs4proc.c
> > index 8522729..da20674 100644
> > --- a/fs/nfsd/nfs4proc.c
> > +++ b/fs/nfsd/nfs4proc.c
> > @@ -99,7 +99,15 @@ do_open_lookup(struct svc_rqst *rqstp, struct svc_fh *current_fh, struct nfsd4_o
> >  		status = nfsd_create_v3(rqstp, current_fh, open->op_fname.data,
> >  					open->op_fname.len, &open->op_iattr,
> >  					&resfh, open->op_createmode,
> > -					(u32 *)open->op_verf.data, &open->op_truncate, &created);
> > +					(u32 *)open->op_verf.data,
> > +					&open->op_truncate, &created);
> > +
> > +		/* If we ever decide to use different attrs to store the
> > +		 * verifier in nfsd_create_v3, then we'll need to change this
> > +		 */
> > +		if (open->op_createmode == NFS4_CREATE_EXCLUSIVE && status == 0)
> > +			open->op_bmval[1] |= (FATTR4_WORD1_TIME_ACCESS |
> > +						FATTR4_WORD1_TIME_MODIFY);
> >  	} else {
> >  		status = nfsd_lookup(rqstp, current_fh,
> >  				     open->op_fname.data, open->op_fname.len, &resfh);
> 
> -------------------------------------------------------------------------
> This SF.net email is sponsored by DB2 Express
> Download DB2 Express C - the FREE version of DB2 express and take
> control of your XML. No limits. Just data. Click to get it now.
> http://sourceforge.net/powerbar/db2/
> _______________________________________________
> NFS maillist  -  NFS@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/nfs
> 


-- 
Jeff Layton <jlayton@redhat.com>

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
NFS maillist  -  NFS@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nfs

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] knfsd: set the response bitmask for NFS4_CREATE_EXCLUSIVE (repost)
  2007-06-27 21:28   ` J. Bruce Fields
@ 2007-06-28  1:30     ` Jeff Layton
  2007-06-28  3:14       ` J. Bruce Fields
  0 siblings, 1 reply; 7+ messages in thread
From: Jeff Layton @ 2007-06-28  1:30 UTC (permalink / raw)
  To: J. Bruce Fields; +Cc: Neil Brown, nfsv4, nfs, Jeff Layton

Here's a respun patch that includes an updated comment in nfsd_create_v3.
Look ok?

------------[snip]-----------

RFC 3530 says:

 If the server uses an attribute to store the exclusive
 create verifier, it will signify which attribute by setting the
 appropriate bit in the attribute mask that is returned in the
 results.

Linux uses the atime and mtime to store the verifier, but sends a zeroed
out bitmask back to the client. This patch makes sure that we set the
correct bits in the bitmask in this situation.

Signed-off-by: Jeff Layton <jlayton@redhat.com>

diff --git a/fs/nfsd/nfs4proc.c b/fs/nfsd/nfs4proc.c
index 8522729..da20674 100644
--- a/fs/nfsd/nfs4proc.c
+++ b/fs/nfsd/nfs4proc.c
@@ -99,7 +99,15 @@ do_open_lookup(struct svc_rqst *rqstp, struct svc_fh *current_fh, struct nfsd4_o
 		status = nfsd_create_v3(rqstp, current_fh, open->op_fname.data,
 					open->op_fname.len, &open->op_iattr,
 					&resfh, open->op_createmode,
-					(u32 *)open->op_verf.data, &open->op_truncate, &created);
+					(u32 *)open->op_verf.data,
+					&open->op_truncate, &created);
+
+		/* If we ever decide to use different attrs to store the
+		 * verifier in nfsd_create_v3, then we'll need to change this
+		 */
+		if (open->op_createmode == NFS4_CREATE_EXCLUSIVE && status == 0)
+			open->op_bmval[1] |= (FATTR4_WORD1_TIME_ACCESS |
+						FATTR4_WORD1_TIME_MODIFY);
 	} else {
 		status = nfsd_lookup(rqstp, current_fh,
 				     open->op_fname.data, open->op_fname.len, &resfh);
diff --git a/fs/nfsd/vfs.c b/fs/nfsd/vfs.c
index 7e6aa24..339b9d0 100644
--- a/fs/nfsd/vfs.c
+++ b/fs/nfsd/vfs.c
@@ -1284,7 +1284,10 @@ nfsd_create_v3(struct svc_rqst *rqstp, struct svc_fh *fhp,
 
 	if (createmode == NFS3_CREATE_EXCLUSIVE) {
 		/* solaris7 gets confused (bugid 4218508) if these have
-		 * the high bit set, so just clear the high bits.
+		 * the high bit set, so just clear the high bits. If this is
+		 * ever changed to use different attrs for storing the
+		 * verifier, then do_open_lookup() will also need to be fixed
+		 * accordingly.
 		 */
 		v_mtime = verifier[0]&0x7fffffff;
 		v_atime = verifier[1]&0x7fffffff;

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
NFS maillist  -  NFS@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nfs

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH] knfsd: set the response bitmask for NFS4_CREATE_EXCLUSIVE (repost)
  2007-06-28  1:30     ` Jeff Layton
@ 2007-06-28  3:14       ` J. Bruce Fields
  2007-06-28 10:54         ` [NFS] " Jeff Layton
  0 siblings, 1 reply; 7+ messages in thread
From: J. Bruce Fields @ 2007-06-28  3:14 UTC (permalink / raw)
  To: Jeff Layton; +Cc: Neil Brown, nfsv4, nfs

On Wed, Jun 27, 2007 at 09:30:47PM -0400, Jeff Layton wrote:
> Here's a respun patch that includes an updated comment in nfsd_create_v3.
> Look ok?

Looks fine to me, thanks.  So this tells the client which attributes it
should set in a subsequent setattr?

It's queued up in my tree, so if Neil doesn't take it then I'll pass it
along to him for v2.6.23....

--b.

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
NFS maillist  -  NFS@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nfs

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [NFS] [PATCH] knfsd: set the response bitmask for NFS4_CREATE_EXCLUSIVE (repost)
  2007-06-28  3:14       ` J. Bruce Fields
@ 2007-06-28 10:54         ` Jeff Layton
  0 siblings, 0 replies; 7+ messages in thread
From: Jeff Layton @ 2007-06-28 10:54 UTC (permalink / raw)
  To: J. Bruce Fields; +Cc: nfs, nfsv4

On Wed, 27 Jun 2007 23:14:16 -0400
"J. Bruce Fields" <bfields@fieldses.org> wrote:

> On Wed, Jun 27, 2007 at 09:30:47PM -0400, Jeff Layton wrote:
> > Here's a respun patch that includes an updated comment in nfsd_create_v3.
> > Look ok?
> 
> Looks fine to me, thanks.  So this tells the client which attributes it
> should set in a subsequent setattr?
> 

Yep. There's a client side patch that went into Trond's tree recently
too. Hopefully I've interpreted the spec correctly ;-)

> It's queued up in my tree, so if Neil doesn't take it then I'll pass it
> along to him for v2.6.23....
> 

Thanks!

> --b.
> 
> -------------------------------------------------------------------------
> This SF.net email is sponsored by DB2 Express
> Download DB2 Express C - the FREE version of DB2 express and take
> control of your XML. No limits. Just data. Click to get it now.
> http://sourceforge.net/powerbar/db2/
> _______________________________________________
> NFS maillist  -  NFS@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/nfs
> 


-- 
Jeff Layton <jlayton@redhat.com>

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2007-06-28 10:54 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-06-27 13:29 [PATCH] knfsd: set the response bitmask for NFS4_CREATE_EXCLUSIVE (repost) Jeff Layton
2007-06-27 21:26 ` Neil Brown
2007-06-27 21:28   ` J. Bruce Fields
2007-06-28  1:30     ` Jeff Layton
2007-06-28  3:14       ` J. Bruce Fields
2007-06-28 10:54         ` [NFS] " Jeff Layton
2007-06-27 21:39   ` Jeff Layton

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.