summaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorLukas Czerner <lczerner@redhat.com>2012-12-07 10:09:19 +0000
committerJosef Bacik <josef@toxicpanda.com>2013-01-14 13:52:31 -0500
commitcc975eb4605c5765a5d5e7a51d24ba5a1cda269e (patch)
tree0f7b9817ec349f6db0333dc8182b8f43df302fe6 /fs
parentcfa7a9ccda711ac6ab8f0d17c3a9b540092d305a (diff)
downloadblackbird-op-linux-cc975eb4605c5765a5d5e7a51d24ba5a1cda269e.tar.gz
blackbird-op-linux-cc975eb4605c5765a5d5e7a51d24ba5a1cda269e.zip
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: Lukas Czerner <lczerner@redhat.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/btrfs/volumes.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c
index 5cce6aa74012..86279c37de64 100644
--- a/fs/btrfs/volumes.c
+++ b/fs/btrfs/volumes.c
@@ -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)
OpenPOWER on IntegriCloud