From a0e35d4f09e63fa91737c6abf40a58401590acc7 Mon Sep 17 00:00:00 2001 From: vmallika Date: Thu, 11 Dec 2014 11:18:03 +0530 Subject: uss/gluster: In SVS, check for entry-point in dict only if inode_ctx is not available. Change-Id: I990487003b712bf4aed8f54291417965f301655e BUG: 1175752 Signed-off-by: vmallika Reviewed-on: http://review.gluster.org/9265 Tested-by: Gluster Build System Reviewed-by: Sachin Pandit Reviewed-by: Rajesh Joseph Reviewed-by: Krishnan Parthasarathi Tested-by: Krishnan Parthasarathi Signed-off-by: Sachin Pandit Reviewed-on: http://review.gluster.org/9347 Reviewed-by: Raghavendra Bhat --- .../features/snapview-server/src/snapview-server.c | 36 ++++++++++++---------- 1 file changed, 19 insertions(+), 17 deletions(-) diff --git a/xlators/features/snapview-server/src/snapview-server.c b/xlators/features/snapview-server/src/snapview-server.c index 5f42a996825..040f444f82f 100644 --- a/xlators/features/snapview-server/src/snapview-server.c +++ b/xlators/features/snapview-server/src/snapview-server.c @@ -509,23 +509,6 @@ svs_lookup (call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *xdata) } } - ret = dict_get_str_boolean (xdata, "entry-point", _gf_false); - if (ret == -1) { - gf_log (this->name, GF_LOG_DEBUG, "failed to get the " - "entry point info"); - entry_point_key = _gf_false; - } else { - entry_point_key = ret; - } - - if (loc->name && strlen (loc->name)) { - /* lookup can come with the entry-point set in the dict - * for the parent directory of the entry-point as well. - * So consider entry_point only for named lookup - */ - entry_point = entry_point_key; - } - if (loc->parent) parent = inode_ref (loc->parent); else { @@ -545,6 +528,25 @@ svs_lookup (call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *xdata) fs = svs_initialise_snapshot_volume (this, dirent->name, NULL); } + if (xdata && !inode_ctx) { + ret = dict_get_str_boolean (xdata, "entry-point", _gf_false); + if (ret == -1) { + gf_log (this->name, GF_LOG_DEBUG, "failed to get the " + "entry point info"); + entry_point_key = _gf_false; + } else { + entry_point_key = ret; + } + + if (loc->name && strlen (loc->name)) { + /* lookup can come with the entry-point set in the dict + * for the parent directory of the entry-point as well. + * So consider entry_point only for named lookup + */ + entry_point = entry_point_key; + } + } + if (inode_ctx && inode_ctx->type == SNAP_VIEW_ENTRY_POINT_INODE) { /* entry-point may not be set in the dictonary. * This can happen if snap-view client is restarted where -- cgit