Btrfs: set FMODE_EXCL in btrfs_device->mode
authorIlya Dryomov <idryomov@gmail.com>
Tue, 15 Feb 2011 18:12:57 +0000 (18:12 +0000)
committerChris Mason <chris.mason@oracle.com>
Wed, 16 Feb 2011 21:34:00 +0000 (16:34 -0500)
This fixes a bug introduced in d4d77629, 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 d4d77629 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>
fs/btrfs/volumes.c

index f31c33119bb6a5c59c259af6735c1c272b949b44..94334d95228086d24e6654ecc24507615e4de558 100644 (file)
@@ -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) {