aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/ordered-data.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/btrfs/ordered-data.c')
-rw-r--r--fs/btrfs/ordered-data.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/btrfs/ordered-data.c b/fs/btrfs/ordered-data.c
index e96634a725c3..aca8264f4a49 100644
--- a/fs/btrfs/ordered-data.c
+++ b/fs/btrfs/ordered-data.c
@@ -968,6 +968,7 @@ int btrfs_ordered_update_i_size(struct inode *inode, u64 offset,
968 struct rb_node *prev = NULL; 968 struct rb_node *prev = NULL;
969 struct btrfs_ordered_extent *test; 969 struct btrfs_ordered_extent *test;
970 int ret = 1; 970 int ret = 1;
971 u64 orig_offset = offset;
971 972
972 spin_lock_irq(&tree->lock); 973 spin_lock_irq(&tree->lock);
973 if (ordered) { 974 if (ordered) {
@@ -983,7 +984,7 @@ int btrfs_ordered_update_i_size(struct inode *inode, u64 offset,
983 984
984 /* truncate file */ 985 /* truncate file */
985 if (disk_i_size > i_size) { 986 if (disk_i_size > i_size) {
986 BTRFS_I(inode)->disk_i_size = i_size; 987 BTRFS_I(inode)->disk_i_size = orig_offset;
987 ret = 0; 988 ret = 0;
988 goto out; 989 goto out;
989 } 990 }