aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs
diff options
context:
space:
mode:
authorYan <yanzheng@21cn.com>2008-01-30 14:39:54 -0500
committerChris Mason <chris.mason@oracle.com>2008-09-25 11:04:00 -0400
commit0181e58f91c1edbf835edb7a87d6dfe81374709d (patch)
tree6c54b29a535e684e22eb73e0a5077c19effedc75 /fs/btrfs
parent1b0f7c29e2f4f41e1367e7581d3a9c8c70f0394a (diff)
btrfs_drop_extent fixe for inline items > 8K
When truncating a inline extent, btrfs_drop_extents doesn't properly handle the case "key.offset > inline_limit". This bug can only happen when max line size is larger than 8K. Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs')
-rw-r--r--fs/btrfs/file.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/fs/btrfs/file.c b/fs/btrfs/file.c
index 7c10a90362ff..7cbf8d8d7e27 100644
--- a/fs/btrfs/file.c
+++ b/fs/btrfs/file.c
@@ -591,8 +591,7 @@ next_slot:
591 } 591 }
592 } 592 }
593 bookend = 1; 593 bookend = 1;
594 if (found_inline && start <= key.offset && 594 if (found_inline && start <= key.offset)
595 inline_limit < extent_end)
596 keep = 1; 595 keep = 1;
597 } 596 }
598 /* truncate existing extent */ 597 /* truncate existing extent */
@@ -672,11 +671,10 @@ next_slot:
672 if (!bookend) 671 if (!bookend)
673 continue; 672 continue;
674 } 673 }
675 if (bookend && found_inline && start <= key.offset && 674 if (bookend && found_inline && start <= key.offset) {
676 inline_limit < extent_end && key.offset <= inline_limit) {
677 u32 new_size; 675 u32 new_size;
678 new_size = btrfs_file_extent_calc_inline_size( 676 new_size = btrfs_file_extent_calc_inline_size(
679 extent_end - inline_limit); 677 extent_end - end);
680 btrfs_truncate_item(trans, root, path, new_size, 0); 678 btrfs_truncate_item(trans, root, path, new_size, 0);
681 } 679 }
682 /* create bookend, splitting the extent in two */ 680 /* create bookend, splitting the extent in two */