From ffae8ec38e9a5fd0aa9a5fbba86a22f805b8cfa8 Mon Sep 17 00:00:00 2001 From: Krutika Dhananjay Date: Wed, 19 Jul 2017 16:14:59 +0530 Subject: storage/posix: Use the ret value of posix_gfid_heal() ... to make the change in commit acf8cfdf truly useful. Without this, a race between entry creation fops and lookup at posix layer can cause lookups to fail with ENODATA, as opposed to ENOENT. Backport of: > Change-Id: I44a226872283a25f1f4812f03f68921c5eb335bb > Reviewed-on: https://review.gluster.org/17821 > BUG: 1472758 > cherry-picked from 669868d23eaeba42809fca7be134137c607d64ed Change-Id: I44a226872283a25f1f4812f03f68921c5eb335bb BUG: 1479717 Signed-off-by: Krutika Dhananjay Reviewed-on: https://review.gluster.org/18010 CentOS-regression: Gluster Build System Reviewed-by: Raghavendra Bhat Smoke: Gluster Build System --- xlators/storage/posix/src/posix.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'xlators/storage/posix/src/posix.c') diff --git a/xlators/storage/posix/src/posix.c b/xlators/storage/posix/src/posix.c index 72c65a18c5f..188b378a58b 100644 --- a/xlators/storage/posix/src/posix.c +++ b/xlators/storage/posix/src/posix.c @@ -247,7 +247,12 @@ posix_lookup (call_frame_t *frame, xlator_t *this, MAKE_ENTRY_HANDLE (real_path, par_path, this, loc, &buf); if (gf_uuid_is_null (loc->inode->gfid)) { - posix_gfid_heal (this, real_path, loc, xdata); + op_ret = posix_gfid_heal (this, real_path, loc, xdata); + if (op_ret < 0) { + op_errno = -op_ret; + op_ret = -1; + goto out; + } MAKE_ENTRY_HANDLE (real_path, par_path, this, loc, &buf); } -- cgit