aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/inode.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/btrfs/inode.c')
-rw-r--r--fs/btrfs/inode.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
index 25f32d7c7ee8..90cb71d68294 100644
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@ -611,13 +611,14 @@ static int btrfs_truncate_in_trans(struct btrfs_trans_handle *trans,
611 item_end += btrfs_file_extent_inline_len(leaf, 611 item_end += btrfs_file_extent_inline_len(leaf,
612 item); 612 item);
613 } 613 }
614 item_end--;
614 } 615 }
615 if (found_type == BTRFS_CSUM_ITEM_KEY) { 616 if (found_type == BTRFS_CSUM_ITEM_KEY) {
616 ret = btrfs_csum_truncate(trans, root, path, 617 ret = btrfs_csum_truncate(trans, root, path,
617 inode->i_size); 618 inode->i_size);
618 BUG_ON(ret); 619 BUG_ON(ret);
619 } 620 }
620 if (item_end <= inode->i_size) { 621 if (item_end < inode->i_size) {
621 if (found_type == BTRFS_DIR_ITEM_KEY) { 622 if (found_type == BTRFS_DIR_ITEM_KEY) {
622 found_type = BTRFS_INODE_ITEM_KEY; 623 found_type = BTRFS_INODE_ITEM_KEY;
623 } else if (found_type == BTRFS_EXTENT_ITEM_KEY) { 624 } else if (found_type == BTRFS_EXTENT_ITEM_KEY) {