summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorN Balachandran <nbalacha@redhat.com>2018-02-19 09:44:29 +0530
committerShyamsundar Ranganathan <srangana@redhat.com>2018-02-23 15:05:17 +0000
commit543b458c082b74ac70ca7f87ab60a0f960acf3c6 (patch)
treecd583506a075e7668a8167989300b3ea87d8e556
parent94660f330737ececb94d00ddac87701bc1244df4 (diff)
cluster/dht: Handle single dht child in dht_lookup
This patch limits itself to only handling the case where no file (data or linkto) exists on the subvol. Additional cases to be handled: 1. A linkto file was found on the only child subvol. This currently calls dht_lookup_everywhere which eventually deletes it. It can be deleted directly as it will not be pointing to a valid subvol. 2. Directory lookups - locking might be unnecessary in some cases. > Change-Id: I940ba34531f2aaee1d36fd9ca45ecfd46be662a4 > BUG: 1546620 > Signed-off-by: N Balachandran <nbalacha@redhat.com> Change-Id: I940ba34531f2aaee1d36fd9ca45ecfd46be662a4 BUG: 1548271 Signed-off-by: N Balachandran <nbalacha@redhat.com>
-rw-r--r--xlators/cluster/dht/src/dht-common.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/xlators/cluster/dht/src/dht-common.c b/xlators/cluster/dht/src/dht-common.c
index 6fd97ca..93b562e 100644
--- a/xlators/cluster/dht/src/dht-common.c
+++ b/xlators/cluster/dht/src/dht-common.c
@@ -3027,6 +3027,12 @@ dht_lookup_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
}
if (ENTRY_MISSING (op_ret, op_errno)) {
+
+ if (1 == conf->subvolume_cnt) {
+ /* No need to lookup again */
+ goto out;
+ }
+
gf_msg_debug (this->name, 0,
"Entry %s missing on subvol %s",
loc->path, prev->name);
@@ -3266,6 +3272,9 @@ dht_lookup (call_frame_t *frame, xlator_t *this,
"path %s", conf->mds_xattr_key, loc->path);
}
+
+ /* Nameless lookup */
+
if (gf_uuid_is_null (loc->pargfid) && !gf_uuid_is_null (loc->gfid) &&
!__is_root_gfid (loc->inode->gfid)) {
local->cached_subvol = NULL;
@@ -3283,6 +3292,9 @@ dht_lookup (call_frame_t *frame, xlator_t *this,
hashed_subvol = dht_subvol_get_hashed (this, loc);
local->hashed_subvol = hashed_subvol;
+
+ /* The entry has been looked up before and has an inode_ctx set
+ */
if (is_revalidate (loc)) {
layout = local->layout;
if (!layout) {
@@ -3323,6 +3335,7 @@ dht_lookup (call_frame_t *frame, xlator_t *this,
"path %s", conf->xattr_name, loc->path);
goto err;
}
+
/* need it in case file is not found on cached file
* on revalidate path and we may encounter linkto files on
* with dht_lookup_everywhere*/