diff options
author | Krutika Dhananjay <kdhananj@redhat.com> | 2019-05-08 13:00:51 +0530 |
---|---|---|
committer | Xavi Hernandez <xhernandez@redhat.com> | 2019-06-04 07:30:12 +0000 |
commit | 400b66d568ad18fefcb59949d1f8368d487b9a80 (patch) | |
tree | 251dfdabd22b02ff1547ac32f8475fd9008edb71 /xlators/features/shard/src/shard.h | |
parent | d8bb432eb776f3a8708ed6cacf1c19fca9524d51 (diff) |
features/shard: Fix block-count accounting upon truncate to lower size
The way delta_blocks is computed in shard is incorrect, when a file
is truncated to a lower size. The accounting only considers change
in size of the last of the truncated shards.
FIX:
Get the block-count of each shard just before an unlink at posix in
xdata. Their summation plus the change in size of last shard
(from an actual truncate) is used to compute delta_blocks which is
used in the xattrop for size update.
Change-Id: I9128a192e9bf8c3c3a959e96b7400879d03d7c53
fixes: bz#1705884
Signed-off-by: Krutika Dhananjay <kdhananj@redhat.com>
Diffstat (limited to 'xlators/features/shard/src/shard.h')
-rw-r--r-- | xlators/features/shard/src/shard.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/xlators/features/shard/src/shard.h b/xlators/features/shard/src/shard.h index cd6a663c03b..04abd62c21c 100644 --- a/xlators/features/shard/src/shard.h +++ b/xlators/features/shard/src/shard.h @@ -275,7 +275,7 @@ typedef struct shard_local { size_t req_size; size_t readdir_size; int64_t delta_size; - int64_t delta_blocks; + gf_atomic_t delta_blocks; loc_t loc; loc_t dot_shard_loc; loc_t dot_shard_rm_loc; |