Btrfs: btrfs_discard_extent must use WRITE with btrfs_map_block.
RFC PATCH 4/12 Btrfs: btrfs_discard_extent must use WRITE with btrfs_map_block.
WRITE is needed on btrfs_map_block() to fetch all raid stripes, READ only returns one device and we want to discard all copies.
Signed-off-by jim owens <[email protected]>
--- fs/btrfs/extent-tree.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
fs/btrfs/extent-tree.c +1 -1
@@ -1594,7 +1594,7 @@ static int btrfs_discard_extent(struct btrfs_root *root, u64 bytenr,return 0 ;/* Tell the block device(s) that the sectors can be discarded */ - ret =btrfs_map_block (&root->fs_info->mapping_tree,READ , + ret =btrfs_map_block (&root->fs_info->mapping_tree,WRITE , bytenr, &map_length, &multi,0 );if (!ret) {struct btrfs_bio_stripe *stripe = multi->stripes;
Signature · 1 line
1.5.6.3