aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/volumes.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/btrfs/volumes.c')
-rw-r--r--fs/btrfs/volumes.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c
index e25e46a8b4e2..cc04dc1445d6 100644
--- a/fs/btrfs/volumes.c
+++ b/fs/btrfs/volumes.c
@@ -1898,7 +1898,6 @@ int btrfs_balance(struct btrfs_root *dev_root)
1898 u64 size_to_free; 1898 u64 size_to_free;
1899 struct btrfs_path *path; 1899 struct btrfs_path *path;
1900 struct btrfs_key key; 1900 struct btrfs_key key;
1901 struct btrfs_chunk *chunk;
1902 struct btrfs_root *chunk_root = dev_root->fs_info->chunk_root; 1901 struct btrfs_root *chunk_root = dev_root->fs_info->chunk_root;
1903 struct btrfs_trans_handle *trans; 1902 struct btrfs_trans_handle *trans;
1904 struct btrfs_key found_key; 1903 struct btrfs_key found_key;
@@ -1962,9 +1961,6 @@ int btrfs_balance(struct btrfs_root *dev_root)
1962 if (found_key.objectid != key.objectid) 1961 if (found_key.objectid != key.objectid)
1963 break; 1962 break;
1964 1963
1965 chunk = btrfs_item_ptr(path->nodes[0],
1966 path->slots[0],
1967 struct btrfs_chunk);
1968 /* chunk zero is special */ 1964 /* chunk zero is special */
1969 if (found_key.offset == 0) 1965 if (found_key.offset == 0)
1970 break; 1966 break;
@@ -3031,8 +3027,7 @@ int btrfs_map_bio(struct btrfs_root *root, int rw, struct bio *bio,
3031 } 3027 }
3032 bio->bi_sector = multi->stripes[dev_nr].physical >> 9; 3028 bio->bi_sector = multi->stripes[dev_nr].physical >> 9;
3033 dev = multi->stripes[dev_nr].dev; 3029 dev = multi->stripes[dev_nr].dev;
3034 BUG_ON(rw == WRITE && !dev->writeable); 3030 if (dev && dev->bdev && (rw != WRITE || dev->writeable)) {
3035 if (dev && dev->bdev) {
3036 bio->bi_bdev = dev->bdev; 3031 bio->bi_bdev = dev->bdev;
3037 if (async_submit) 3032 if (async_submit)
3038 schedule_bio(root, dev, rw, bio); 3033 schedule_bio(root, dev, rw, bio);