diff options
author | Sheetal Pamecha <spamecha@redhat.com> | 2019-10-22 14:34:06 +0530 |
---|---|---|
committer | hari gowtham <hari.gowtham005@gmail.com> | 2019-11-13 05:05:54 +0000 |
commit | 7808a10af0949ee19ba4c0ab000732ba7eb67f02 (patch) | |
tree | dfe9c332ac08678d036c6eda21fd5a5137344d54 /xlators | |
parent | fc5a3dd8757ffc80869173e4758d068be2cf5d19 (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>
>(Reviewed on upstream link https://review.gluster.org/#/c/glusterfs/+/23585/)
Fixes: bz#1768760
Change-Id: I81625c7451dabf006c0864d859b1600f3521b648
Signed-off-by: Sheetal Pamecha <spamecha@redhat.com>
Diffstat (limited to 'xlators')
-rw-r--r-- | xlators/features/shard/src/shard.c | 1 |
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) |