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.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c
index 0c7f478cf645..e8be478178aa 100644
--- a/fs/btrfs/volumes.c
+++ b/fs/btrfs/volumes.c
@@ -600,8 +600,10 @@ static int __btrfs_open_devices(struct btrfs_fs_devices *fs_devices,
600 set_blocksize(bdev, 4096); 600 set_blocksize(bdev, 4096);
601 601
602 bh = btrfs_read_dev_super(bdev); 602 bh = btrfs_read_dev_super(bdev);
603 if (!bh) 603 if (!bh) {
604 ret = -EINVAL;
604 goto error_close; 605 goto error_close;
606 }
605 607
606 disk_super = (struct btrfs_super_block *)bh->b_data; 608 disk_super = (struct btrfs_super_block *)bh->b_data;
607 devid = btrfs_stack_device_id(&disk_super->dev_item); 609 devid = btrfs_stack_device_id(&disk_super->dev_item);
@@ -702,7 +704,7 @@ int btrfs_scan_one_device(const char *path, fmode_t flags, void *holder,
702 goto error_close; 704 goto error_close;
703 bh = btrfs_read_dev_super(bdev); 705 bh = btrfs_read_dev_super(bdev);
704 if (!bh) { 706 if (!bh) {
705 ret = -EIO; 707 ret = -EINVAL;
706 goto error_close; 708 goto error_close;
707 } 709 }
708 disk_super = (struct btrfs_super_block *)bh->b_data; 710 disk_super = (struct btrfs_super_block *)bh->b_data;
@@ -1302,7 +1304,7 @@ int btrfs_rm_device(struct btrfs_root *root, char *device_path)
1302 set_blocksize(bdev, 4096); 1304 set_blocksize(bdev, 4096);
1303 bh = btrfs_read_dev_super(bdev); 1305 bh = btrfs_read_dev_super(bdev);
1304 if (!bh) { 1306 if (!bh) {
1305 ret = -EIO; 1307 ret = -EINVAL;
1306 goto error_close; 1308 goto error_close;
1307 } 1309 }
1308 disk_super = (struct btrfs_super_block *)bh->b_data; 1310 disk_super = (struct btrfs_super_block *)bh->b_data;