Fix btrfs_get_extent and get_block corner cases, and disable O_DIRECT reads
The generic O_DIRECT code assumes all the bios have the same bdev,
which isn't true for multi-device btrfs.
Signed-off-by: Chris Mason <chris.mason@oracle.com>
diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c
index 5619e50..bccb556 100644
--- a/fs/btrfs/volumes.c
+++ b/fs/btrfs/volumes.c
@@ -1161,7 +1161,6 @@
int total_devs = 1;
length = bio->bi_size;
-
map_tree = &root->fs_info->mapping_tree;
map_length = length;
@@ -1192,6 +1191,7 @@
}
bio->bi_sector = multi->stripes[dev_nr].physical >> 9;
dev = multi->stripes[dev_nr].dev;
+
bio->bi_bdev = dev->bdev;
spin_lock(&dev->io_lock);
dev->total_ios++;