Skip to content

Commit db73059

Browse files
author
chenjinhao
committed
shard: correct file-size xattr in fallocate request failure
When the fallocate request to a file returns a failure, there may actually be data written to the backend bricks. So, we do need to refresh file-size xattr for such a file, in that case. Fixes: #4522 Signed-off-by: chenjinhao <chen.jinhao@zte.com.cn>
1 parent a9f3973 commit db73059

File tree

1 file changed

+7
-12
lines changed

1 file changed

+7
-12
lines changed

xlators/features/shard/src/shard.c

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5572,18 +5572,13 @@ shard_common_inode_write_do_cbk(call_frame_t *frame, void *cookie,
55725572
call_count = shard_call_count_return(frame);
55735573
if (call_count == 0) {
55745574
SHARD_UNSET_ROOT_FS_ID(frame, local);
5575-
if (local->op_ret < 0) {
5576-
shard_common_failure_unwind(fop, frame, local->op_ret,
5577-
local->op_errno);
5578-
} else {
5579-
shard_get_delta_size_from_inode_ctx(local, local->fd->inode, this);
5580-
local->hole_size = 0;
5581-
if (xdata)
5582-
local->xattr_rsp = dict_ref(xdata);
5583-
shard_update_file_size(
5584-
frame, this, local->fd, NULL,
5585-
shard_common_inode_write_post_update_size_handler);
5586-
}
5575+
shard_get_delta_size_from_inode_ctx(local, local->fd->inode, this);
5576+
local->hole_size = 0;
5577+
if (xdata)
5578+
local->xattr_rsp = dict_ref(xdata);
5579+
shard_update_file_size(
5580+
frame, this, local->fd, NULL,
5581+
shard_common_inode_write_post_update_size_handler);
55875582
}
55885583

55895584
return 0;

0 commit comments

Comments
 (0)