summaryrefslogtreecommitdiffstats
path: root/xlators/features
diff options
context:
space:
mode:
authorSheetal Pamecha <spamecha@redhat.com>2019-10-22 14:34:06 +0530
committerKrutika Dhananjay <kdhananj@redhat.com>2019-11-01 01:03:51 +0000
commit13cb14811cdea477780e58ba35493479c7a04a25 (patch)
treee6fb82b42604f993fa51e2fa1a1b448055fa17dd /xlators/features
parent42c1605f42b89520d4d05806d7074e9e93b63640 (diff)
tests/shard: fix tests/bugs/shard/unlinks-and-renames.t failure
on rhel8 machine cleanup of shards is not happening properly for a sharded file with hard-links. It needs to refresh the hard link count to make it successful The problem occurs when a sharded file with hard-links gets removed. When the last link file is removed, all shards need to be cleaned up. But in the current code structure shard xlator, instead of sending a lookup to get the link count uses stale cache values of inodectx. Therby removing the base shard but not the shards present in /.shard directory. This fix will make sure that it marks in the first unlink's callback that the inode ctx needs a refresh so that in the next operation, it will be refreshed by looking up the file on-disk. fixes: bz#1764110 Change-Id: I81625c7451dabf006c0864d859b1600f3521b648 Signed-off-by: Sheetal Pamecha <spamecha@redhat.com>
Diffstat (limited to 'xlators/features')
-rw-r--r--xlators/features/shard/src/shard.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/xlators/features/shard/src/shard.c b/xlators/features/shard/src/shard.c
index 234300dee81..0e96a45768a 100644
--- a/xlators/features/shard/src/shard.c
+++ b/xlators/features/shard/src/shard.c
@@ -4036,6 +4036,7 @@ shard_unlink_base_file_cbk(call_frame_t *frame, void *cookie, xlator_t *this,
local->op_ret = op_ret;
local->op_errno = op_errno;
} else {
+ shard_inode_ctx_set_refresh_flag(local->int_inodelk.loc.inode, this);
local->preoldparent = *preparent;
local->postoldparent = *postparent;
if (xdata)