From 13cb14811cdea477780e58ba35493479c7a04a25 Mon Sep 17 00:00:00 2001 From: Sheetal Pamecha Date: Tue, 22 Oct 2019 14:34:06 +0530 Subject: 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 --- xlators/features/shard/src/shard.c | 1 + 1 file changed, 1 insertion(+) (limited to 'xlators/features/shard/src') 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) -- cgit