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 <jow...@hp.com>
---
 fs/btrfs/extent-tree.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c
index b610557..185d273 100644
--- a/fs/btrfs/extent-tree.c
+++ b/fs/btrfs/extent-tree.c
@@ -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;
-- 
1.5.6.3
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to