summaryrefslogtreecommitdiffstats
path: root/xlators
diff options
context:
space:
mode:
authorKotresh HR <khiremat@redhat.com>2016-06-22 13:05:10 +0530
committerRaghavendra G <rgowdapp@redhat.com>2016-07-01 06:30:21 -0700
commit2687bc68a5f91e8f940a8eef1b47052736116556 (patch)
tree86fbbd2703cb6dcaefa49bafb5527debf8ac0015 /xlators
parentaf1ab7266edf91216e27484c505c78401f092e13 (diff)
feature/gfid-access: Fix nameless lookup on ".gfid"
Backport of http://review.gluster.org/14773 Problem: In geo-replication, if the data copied from .snaps directory to the master, the first set of copy after uss is enabled doesn't get sync to slave. Cause: Enabling uss results in graph switch. So when the lookup comes on "0x00...0d/gfid1" on new graph, ("0x00...0d' being the gfid of virtual directory ".gfid"), it fails as gfid-access xlator doesn't handle it. Fix: Handle nameless lookup on ".gfid" in gfid-access xlator. Change-Id: I32be0064e8fd58068646dbf662432f4a3da14e77 BUG: 1349271 Signed-off-by: Kotresh HR <khiremat@redhat.com> (cherry picked from commit b37c6d9088851b2ef83ce4e28af642892e5fd268) Reviewed-on: http://review.gluster.org/14775 Smoke: Gluster Build System <jenkins@build.gluster.org> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> CentOS-regression: Gluster Build System <jenkins@build.gluster.org> Reviewed-by: Raghavendra G <rgowdapp@redhat.com>
Diffstat (limited to 'xlators')
-rw-r--r--xlators/features/gfid-access/src/gfid-access.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/xlators/features/gfid-access/src/gfid-access.c b/xlators/features/gfid-access/src/gfid-access.c
index 438fb08..da2cda9 100644
--- a/xlators/features/gfid-access/src/gfid-access.c
+++ b/xlators/features/gfid-access/src/gfid-access.c
@@ -799,6 +799,16 @@ ga_lookup (call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *xdata)
inode_t *true_inode = NULL;
int32_t op_errno = ENOENT;
+ priv = this->private;
+
+ /* Handle nameless lookup on ".gfid" */
+ if (!loc->parent && __is_gfid_access_dir(loc->gfid)) {
+ STACK_UNWIND_STRICT (lookup, frame, 0, 0, loc->inode,
+ &priv->gfiddir_stbuf, xdata,
+ &priv->root_stbuf);
+ return 0;
+ }
+
/* if its discover(), no need for any action here */
if (!loc->name)
goto wind;
@@ -831,8 +841,6 @@ ga_lookup (call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *xdata)
goto wind;
}
- priv = this->private;
-
/* need to check if the lookup is on virtual dir */
if ((loc->name && !strcmp (GF_GFID_DIR, loc->name)) &&
((loc->parent && __is_root_gfid (loc->parent->gfid)) ||