Patchwork [BRANCH:release-3.1,BUG:2553,2/2] nfs: Remove redundant and erroneous check for create mode EXCLUSIVE

login
register
Submitter Shehjar Tikoo
Date 2011-03-29 09:20:19
Message ID <1301390419-31782-2-git-send-email-shehjart@gluster.com>
Download mbox | patch
Permalink /patch/6623/
State Accepted
Headers show

Comments

Shehjar Tikoo - 2011-03-29 09:20:19
From: Shehjar Tikoo <shehjart@gluster.com>

nfs3.c/nfs3_create_common:

The if condition checks for create mode being EXCLUSIVE. However, when
create mode is EXCLUSIVE, this function never gets called (nfs3_create_exclusive
is called). Also, instead of checking, it actually sets the value of createmode (= instead of ==).

Signed-off-by: Shehjar Tikoo <shehjart@gluster.com>
---
 xlators/nfs/server/src/nfs3.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Patch

diff --git a/xlators/nfs/server/src/nfs3.c b/xlators/nfs/server/src/nfs3.c
index 0c2f88b..4d2ab3d 100644
--- a/xlators/nfs/server/src/nfs3.c
+++ b/xlators/nfs/server/src/nfs3.c
@@ -2361,7 +2361,7 @@  nfs3_create_common (nfs3_call_state_t *cs)
         if (!cs)
                 return ret;
 
-        if ((cs->createmode == UNCHECKED) || (cs->createmode = EXCLUSIVE))
+        if (cs->createmode == UNCHECKED)
                 flags = O_RDWR;
         else if (cs->createmode == GUARDED)
                 flags = (O_RDWR | O_EXCL);