Skip to content

Commit

Permalink
btrfs: get the device in write mode when deleting it
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Lukas Czerner authored and Josef Bacik committed Jan 14, 2013
1 parent cfa7a9c commit cc975eb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/btrfs/volumes.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit cc975eb

Please sign in to comment.