Skip to content

Commit

Permalink
Btrfs: set FMODE_EXCL in btrfs_device->mode
Browse files Browse the repository at this point in the history
This fixes a bug introduced in d4d7762, where the device added online
(and therefore initialized via btrfs_init_new_device()) would be left
with the positive bdev->bd_holders after unmount.  Since d4d7762 we no
longer OR FMODE_EXCL explicitly on blkdev_put(), set it in
btrfs_device->mode.

Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
  • Loading branch information
Ilya Dryomov authored and Chris Mason committed Feb 16, 2011
1 parent 9b3517e commit fb01aa8
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 @@ -1639,7 +1639,7 @@ int btrfs_init_new_device(struct btrfs_root *root, char *device_path)
device->dev_root = root->fs_info->dev_root;
device->bdev = bdev;
device->in_fs_metadata = 1;
device->mode = 0;
device->mode = FMODE_EXCL;
set_blocksize(device->bdev, 4096);

if (seeding_dev) {
Expand Down

0 comments on commit fb01aa8

Please sign in to comment.