summaryrefslogtreecommitdiffstats
path: root/xlators/storage
diff options
context:
space:
mode:
authorshishir gowda <shishirng@gluster.com>2012-02-28 18:03:29 +0530
committerVijay Bellur <vijay@gluster.com>2012-02-29 02:09:59 -0800
commit5ad1c2caed743fc10a0645055a825252dfbf77ba (patch)
treed8ed477083a1a8a64089a243e1ab452bde035d85 /xlators/storage
parentc2c82c360fda20533093c27c82ce0725cf40cab5 (diff)
storage/posix: In lookup check for buf->gfid being NULL
There are few cases where create and lookup race. Lookup ends up getting a valid struct iatt, but with no gfid set. We need to check for gfid being 0, and handle it as an error. Signed-off-by: shishir gowda <shishirng@gluster.com> Change-Id: I36ae1978b325aff964cbc3b24730c1e993666267 BUG: 797167 Reviewed-on: http://review.gluster.com/2832 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Amar Tumballi <amarts@redhat.com> Reviewed-by: Vijay Bellur <vijay@gluster.com>
Diffstat (limited to 'xlators/storage')
-rw-r--r--xlators/storage/posix/src/posix.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/xlators/storage/posix/src/posix.c b/xlators/storage/posix/src/posix.c
index a59d2c383fd..84d1d11a5db 100644
--- a/xlators/storage/posix/src/posix.c
+++ b/xlators/storage/posix/src/posix.c
@@ -159,6 +159,12 @@ out:
if (xattr)
dict_ref (xattr);
+ if (!op_ret && uuid_is_null (buf.ia_gfid)) {
+ gf_log (this->name, GF_LOG_ERROR, "buf->ia_gfid is null for "
+ "%s", (real_path) ? real_path: "");
+ op_ret = -1;
+ op_errno = ENOENT;
+ }
STACK_UNWIND_STRICT (lookup, frame, op_ret, op_errno,
(loc)?loc->inode:NULL, &buf, xattr, &postparent);