From 5ad1c2caed743fc10a0645055a825252dfbf77ba Mon Sep 17 00:00:00 2001 From: shishir gowda Date: Tue, 28 Feb 2012 18:03:29 +0530 Subject: 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 Change-Id: I36ae1978b325aff964cbc3b24730c1e993666267 BUG: 797167 Reviewed-on: http://review.gluster.com/2832 Tested-by: Gluster Build System Reviewed-by: Amar Tumballi Reviewed-by: Vijay Bellur --- xlators/storage/posix/src/posix.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'xlators') 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); -- cgit