提交 cc975eb4 编写于 作者: L Lukas Czerner 提交者: 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: NLukas Czerner <lczerner@redhat.com>
上级 cfa7a9cc
......@@ -1431,7 +1431,7 @@ int btrfs_rm_device(struct btrfs_root *root, char *device_path)
}
} else {
ret = btrfs_get_bdev_and_sb(device_path,
FMODE_READ | FMODE_EXCL,
FMODE_WRITE | FMODE_EXCL,
root->fs_info->bdev_holder, 0,
&bdev, &bh);
if (ret)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册