diff options
author | Anand Avati <avati@redhat.com> | 2012-09-17 12:56:49 -0700 |
---|---|---|
committer | Anand Avati <avati@redhat.com> | 2012-09-17 18:52:33 -0700 |
commit | 0d3bec589748b4cc8295d9ed109d21c94e3d8854 (patch) | |
tree | 242e8b66f10b03b59d42370620336e25f5d0ac1a | |
parent | 92d2720b2764c2ce399751b1cbbf691fc3f53489 (diff) |
mount/fuse: treat NULL gfid is a failure in lookup disregarding op_ret
It is not possible to inode_link() with a NULL gfid. If a lookup
(or any other "entry" op) returns a success but has a NULL gfid,
then treat it as a failure even if op_ret was 0.
Currently AFR does this when self-healing fails/aborts in certain
situations (like entrylk acquisition failure, gfid mismatch etc.)
returning a NULL gfid in struct iatt of lookup_cbk with op_ret = 0.
Fixing this is an independent patch and fuse-bridge needs to be
robust against such misformed replies in any case.
Change-Id: If5f75780c0b5b1303f466711f1992f90a77e768a
BUG: 856921
Signed-off-by: Anand Avati <avati@redhat.com>
Reviewed-on: http://review.gluster.org/3952
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Brian Foster <bfoster@redhat.com>
-rw-r--r-- | xlators/mount/fuse/src/fuse-bridge.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/xlators/mount/fuse/src/fuse-bridge.c b/xlators/mount/fuse/src/fuse-bridge.c index bced86442..6dfc334be 100644 --- a/xlators/mount/fuse/src/fuse-bridge.c +++ b/xlators/mount/fuse/src/fuse-bridge.c @@ -295,8 +295,20 @@ fuse_entry_cbk (call_frame_t *frame, void *cookie, xlator_t *this, state = frame->root->state; finh = state->finh; - if (!op_ret && __is_root_gfid (state->loc.inode->gfid)) { - buf->ia_ino = 1; + if (op_ret == 0) { + if (__is_root_gfid (state->loc.inode->gfid)) + buf->ia_ino = 1; + if (uuid_is_null (buf->ia_gfid)) { + /* With a NULL gfid inode linking is + not possible. Let's not pretend this + call was a "success". + */ + gf_log ("glusterfs-fuse", GF_LOG_WARNING, + "Received NULL gfid for %s. Forcing EIO", + state->loc.path); + op_ret = -1; + op_errno = EIO; + } } if (op_ret == 0) { |