Skip to contentSkip to conversation

Btrfs: set FMODE_EXCL in btrfs_device->mode

PATCH New Ilya Dryomov 1 participant 1 message Feb 15, 2011 Btrfs file system

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Btrfs: set FMODE_EXCL in btrfs_device->mode

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.

---
 fs/btrfs/volumes.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
fs/btrfs/volumes.c +1 -1
index 2636a05..a228f63 100644
@@ -1631,7 +1631,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) {
Signature · 1 line
1.7.2.3