Patchwork [BUG:2553] NFS : Don't set setattr_valid for exclusive create call.

login
register
Submitter Gaurav
Date 2011-06-08 11:29:03
Message ID <1307532543-5496-1-git-send-email-gaurav@gluster.com>
Download mbox | patch
Permalink /patch/7412/
State Accepted
Headers show

Comments

Gaurav - 2011-06-08 11:29:03
From: Gaurav <gaurav@gluster.com>


Signed-off-by: Gaurav <gaurav@gluster.com>
---
 xlators/nfs/server/src/nfs3.c |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)
Shehjar Tikoo - 2011-06-09 06:27:32
Not reviewed OK.
See inline please.

gaurav@gluster.com wrote:
> From: Gaurav <gaurav@gluster.com>
> 
> 
> Signed-off-by: Gaurav <gaurav@gluster.com>
> ---
>  xlators/nfs/server/src/nfs3.c |    7 +++++--
>  1 files changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/xlators/nfs/server/src/nfs3.c b/xlators/nfs/server/src/nfs3.c
> index 2fc295e..cd0a543 100644
> --- a/xlators/nfs/server/src/nfs3.c
> +++ b/xlators/nfs/server/src/nfs3.c
....
....
....
> @@ -2525,7 +2525,10 @@ nfs3_create (rpcsvc_request_t *req, struct nfs3_fh *dirfh, char *name,
>          nfs3_handle_call_state_init (nfs3, cs, req, vol, stat, nfs3err);
>  
>          cs->cookieverf = cverf;
> -        cs->setattr_valid = nfs3_sattr3_to_setattr_valid (sattr, &cs->stbuf,
> +        /*In Exclusive create client is supposed to send cverf instead of
> +         * sattr*/
> +        if (mode != EXCLUSIVE)
> +                cs->setattr_valid = nfs3_sattr3_to_setattr_valid (sattr, &cs->stbuf,
>                                                            &cs->mode);

Fix the indentation for &cs->mode line and re-submit for all releases.

-Shehjar

>          cs->createmode = mode;
>          cs->parent = *dirfh;

Patch

diff --git a/xlators/nfs/server/src/nfs3.c b/xlators/nfs/server/src/nfs3.c
index 2fc295e..cd0a543 100644
--- a/xlators/nfs/server/src/nfs3.c
+++ b/xlators/nfs/server/src/nfs3.c
@@ -2461,7 +2461,7 @@  nfs3_create_exclusive (nfs3_call_state_t *cs)
                 ret = nfs_create (cs->nfsx, cs->vol, &nfu, &cs->resolvedloc,
                                   O_RDWR, cs->mode, nfs3svc_create_cbk, cs);
         } else
-                ret = nfs_create (cs->nfsx, cs->vol, &nfu, &cs->oploc, O_RDWR,
+                ret = nfs_create (cs->nfsx, cs->vol, &nfu, &cs->resolvedloc, O_RDWR,
                                   NFS_DEFAULT_CREATE_MODE, nfs3svc_create_cbk,
                                   cs);
 
@@ -2525,7 +2525,10 @@  nfs3_create (rpcsvc_request_t *req, struct nfs3_fh *dirfh, char *name,
         nfs3_handle_call_state_init (nfs3, cs, req, vol, stat, nfs3err);
 
         cs->cookieverf = cverf;
-        cs->setattr_valid = nfs3_sattr3_to_setattr_valid (sattr, &cs->stbuf,
+        /*In Exclusive create client is supposed to send cverf instead of
+         * sattr*/
+        if (mode != EXCLUSIVE)
+                cs->setattr_valid = nfs3_sattr3_to_setattr_valid (sattr, &cs->stbuf,
                                                           &cs->mode);
         cs->createmode = mode;
         cs->parent = *dirfh;