Patchwork [BUG:854,3/5] nfs3: Error returns must check for <0, not == -1

login
register
Submitter Shehjar Tikoo
Date 2010-07-27 11:46:51
Message ID <1280231213-3137-3-git-send-email-shehjart@gluster.com>
Download mbox | patch
Permalink /patch/3921/
State Accepted
Delegated to: Anand Avati
Headers show

Comments

Shehjar Tikoo - 2010-07-27 11:46:51
From: Shehjar Tikoo <shehjart@gluster.com>


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

Patch

diff --git a/xlators/nfs/server/src/nfs3.c b/xlators/nfs/server/src/nfs3.c
index 21f8f11..21cd23a 100644
--- a/xlators/nfs/server/src/nfs3.c
+++ b/xlators/nfs/server/src/nfs3.c
@@ -107,7 +107,7 @@ 
 
 #define nfs3_check_fh_resolve_status(cst, nfstat, erlabl)               \
         do {                                                            \
-                if ((cst)->resolve_ret == -1) {                         \
+                if ((cst)->resolve_ret < 0) {                           \
                         nfstat = nfs3_errno_to_nfsstat3 (cst->resolve_errno);\
                         goto erlabl;                                    \
                 }                                                       \
@@ -115,7 +115,7 @@ 
 
 #define nfs3_check_new_fh_resolve_status(cst, nfstat, erlabl)           \
         do {                                                            \
-                if (((cst)->resolve_ret == -1) &&                       \
+                if (((cst)->resolve_ret < 0) &&                         \
                     ((cst)->resolve_errno != ENOENT)) {                 \
                         nfstat = nfs3_errno_to_nfsstat3 (cs->resolve_errno);\
                         goto erlabl;                                    \