diff --git a/fs/btrfs/inode-item.c b/fs/btrfs/inode-item.c index f7b02abb681b..ef1a9efe08c0 100644 --- a/fs/btrfs/inode-item.c +++ b/fs/btrfs/inode-item.c @@ -646,14 +646,11 @@ int btrfs_truncate_inode_items(struct btrfs_trans_handle *trans, } } - if (del_item) - control->last_size = found_key.offset; - else - control->last_size = new_size; if (del_item) { ASSERT(!pending_del_nr || ((path->slots[0] + 1) == pending_del_slot)); + control->last_size = found_key.offset; if (!pending_del_nr) { /* No pending yet, add ourselves */ pending_del_slot = path->slots[0]; @@ -665,6 +662,7 @@ int btrfs_truncate_inode_items(struct btrfs_trans_handle *trans, pending_del_slot = path->slots[0]; } } else { + control->last_size = new_size; break; } should_throttle = false;