summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPranith K <pranithk@gluster.com>2011-07-14 06:31:33 +0000
committerAnand Avati <avati@gluster.com>2011-07-17 07:45:35 -0700
commit61f68b31f24311d09f4d2a02968ff52fd7b5a73f (patch)
treeff8de8c90ac95b232049902e968ec9b373dcaee4
parent5dff9a2938c199285662bb5b33d7e3aeda0e3fb6 (diff)
storage/posix: Succeed lookup even if there is no gfid on the file
Signed-off-by: Pranith Kumar K <pranithk@gluster.com> Signed-off-by: Anand Avati <avati@gluster.com> BUG: 2745 (failure to detect split brain) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2745
-rw-r--r--xlators/storage/posix/src/posix-helpers.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/xlators/storage/posix/src/posix-helpers.c b/xlators/storage/posix/src/posix-helpers.c
index 5aa09d977..43a5a7053 100644
--- a/xlators/storage/posix/src/posix-helpers.c
+++ b/xlators/storage/posix/src/posix-helpers.c
@@ -188,7 +188,7 @@ posix_fill_gfid_path (xlator_t *this, const char *path, struct iatt *iatt)
ret = sys_lgetxattr (path, GFID_XATTR_KEY, iatt->ia_gfid, 16);
/* Return value of getxattr */
- if (ret == 16)
+ if ((ret == 16) || (ret == -1))
ret = 0;
return ret;
@@ -205,7 +205,7 @@ posix_fill_gfid_fd (xlator_t *this, int fd, struct iatt *iatt)
ret = sys_fgetxattr (fd, GFID_XATTR_KEY, iatt->ia_gfid, 16);
/* Return value of getxattr */
- if (ret == 16)
+ if ((ret == 16) || (ret == -1))
ret = 0;
return ret;