aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/file.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/btrfs/file.c')
-rw-r--r--fs/btrfs/file.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/fs/btrfs/file.c b/fs/btrfs/file.c
index 482f8db2cfd0..da3ed965c956 100644
--- a/fs/btrfs/file.c
+++ b/fs/btrfs/file.c
@@ -363,15 +363,16 @@ out:
363 */ 363 */
364noinline int btrfs_drop_extents(struct btrfs_trans_handle *trans, 364noinline int btrfs_drop_extents(struct btrfs_trans_handle *trans,
365 struct btrfs_root *root, struct inode *inode, 365 struct btrfs_root *root, struct inode *inode,
366 u64 start, u64 end, u64 inline_limit, u64 *hint_byte) 366 u64 start, u64 end, u64 locked_end,
367 u64 inline_limit, u64 *hint_byte)
367{ 368{
368 u64 extent_end = 0; 369 u64 extent_end = 0;
369 u64 locked_end = end;
370 u64 search_start = start; 370 u64 search_start = start;
371 u64 leaf_start; 371 u64 leaf_start;
372 u64 ram_bytes = 0; 372 u64 ram_bytes = 0;
373 u64 orig_parent = 0; 373 u64 orig_parent = 0;
374 u64 disk_bytenr = 0; 374 u64 disk_bytenr = 0;
375 u64 orig_locked_end = locked_end;
375 u8 compression; 376 u8 compression;
376 u8 encryption; 377 u8 encryption;
377 u16 other_encoding = 0; 378 u16 other_encoding = 0;
@@ -684,9 +685,9 @@ next_slot:
684 } 685 }
685out: 686out:
686 btrfs_free_path(path); 687 btrfs_free_path(path);
687 if (locked_end > end) { 688 if (locked_end > orig_locked_end) {
688 unlock_extent(&BTRFS_I(inode)->io_tree, end, locked_end - 1, 689 unlock_extent(&BTRFS_I(inode)->io_tree, orig_locked_end,
689 GFP_NOFS); 690 locked_end - 1, GFP_NOFS);
690 } 691 }
691 btrfs_check_file(root, inode); 692 btrfs_check_file(root, inode);
692 return ret; 693 return ret;