Skip to contentSkip to conversation

btrfs: fix inconsistency during missing device rejoin

PATCH RESEND New Anand Jain 1 participant 1 message Dec 15, 2017 Btrfs file system

lore
Share & tools
lore

Anand Jain

author
#0 lore raw

PATCH RESEND 1/1 btrfs: fix inconsistency during missing device rejoin

When device is missing its not necessary that btrfs_device::name is null or the path is different when it reappears. Its possible that device can go missing after its been scanned where neither of btrfs_device::name == NULL OR btrfs_device::name != reappear_dev_path, is true. So just check for btrfs_device::dev_state.missing. Thanks.

---
 fs/btrfs/volumes.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
fs/btrfs/volumes.c +2 -1
index ba06a4ccd5a6..93d65c72b731 100644
@@ -767,7 +767,8 @@ static noinline int device_list_add(const char *path,
 		ret = 1;
 		device->fs_devices = fs_devices;
 		btrfs_free_stale_device(path, device);
-	} else if (!device->name || strcmp(device->name->str, path)) {
+	} else if (!device->name || strcmp(device->name->str, path) ||
+			test_bit(BTRFS_DEV_STATE_MISSING, &device->dev_state)) {
 		/*
 		 * When FS is already mounted.
 		 * 1. If you are here and if the device->name is NULL that
Signature · 1 line
2.7.0