Commit cc975eb4 authored by Lukas Czerner's avatar Lukas Czerner Committed by Josef Bacik

btrfs: get the device in write mode when deleting it

When we're deleting the device we should get it in write mode since
we're going to re-write the super block magic on that device. And it
should fail if the device is read-only.
Signed-off-by: default avatarLukas Czerner <lczerner@redhat.com>
parent cfa7a9cc
...@@ -1431,7 +1431,7 @@ int btrfs_rm_device(struct btrfs_root *root, char *device_path) ...@@ -1431,7 +1431,7 @@ int btrfs_rm_device(struct btrfs_root *root, char *device_path)
} }
} else { } else {
ret = btrfs_get_bdev_and_sb(device_path, ret = btrfs_get_bdev_and_sb(device_path,
FMODE_READ | FMODE_EXCL, FMODE_WRITE | FMODE_EXCL,
root->fs_info->bdev_holder, 0, root->fs_info->bdev_holder, 0,
&bdev, &bh); &bdev, &bh);
if (ret) if (ret)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment