summaryrefslogtreecommitdiffstats
path: root/xlators/features/shard/src
diff options
context:
space:
mode:
authorKrutika Dhananjay <kdhananj@redhat.com>2015-08-31 12:43:36 +0530
committerVijay Bellur <vbellur@redhat.com>2015-08-31 08:08:07 -0700
commit7566c94633b602156755297493fad1d24d1ba52f (patch)
treedd99480df28b46085e647aac7fd7d3d64e9d24e6 /xlators/features/shard/src
parentfb8c9b38d8c42ecaf17df6e28c2a97d2cf13fb14 (diff)
features/shard: Fix unlink failure due to non-existent shard(s)
Unlink of a sharded file with holes was leading to EINVAL errors because it was being wound on non-existent shards (those blocks that fall in the hole region). loc->inode was NULL in these cases and dht_unlink used to fail the FOP with EINVAL for failure to fetch cached subvol for the inode. The fix involves winding unlink on only those shards whose corresponding inodes exist in memory. Change-Id: I993ff70cab4b22580c772a9c74fc19ac893a03fc BUG: 1258334 Signed-off-by: Krutika Dhananjay <kdhananj@redhat.com> Reviewed-on: http://review.gluster.org/12059 Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com> Tested-by: NetBSD Build System <jenkins@build.gluster.org> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Diffstat (limited to 'xlators/features/shard/src')
-rw-r--r--xlators/features/shard/src/shard.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/xlators/features/shard/src/shard.c b/xlators/features/shard/src/shard.c
index 6fb57168371..8b784eca1a8 100644
--- a/xlators/features/shard/src/shard.c
+++ b/xlators/features/shard/src/shard.c
@@ -1789,13 +1789,12 @@ shard_unlink_shards_do (call_frame_t *frame, xlator_t *this, inode_t *inode)
return 0;
}
+ local->call_count = call_count = count;
+ cur_block = 1;
SHARD_SET_ROOT_FS_ID (frame, local);
while (cur_block <= last_block) {
- /* The base file is unlinked in the end to mark the
- * successful completion of the fop.
- */
- if (cur_block == 0) {
+ if (!local->inode_list[cur_block]) {
cur_block++;
continue;
}