diff mbox

Btrfs: btrfs_discard_extent must use WRITE with btrfs_map_block.

Message ID 4B2AD16E.70608@hp.com (mailing list archive)
State Under Review, archived
Headers show

Commit Message

jim owens Dec. 18, 2009, 12:48 a.m. UTC
None
diff mbox

Patch

diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c
index 86bc625..adc59fa 100644
--- a/fs/btrfs/extent-tree.c
+++ b/fs/btrfs/extent-tree.c
@@ -1585,7 +1585,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;