Skip to contentSkip to conversation

Btrfs: adjust the fs_devices->missing count on unmount

PATCH New Josef Bacik 1 participant 1 message Aug 26, 2013 Btrfs file system

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Btrfs: adjust the fs_devices->missing count on unmount

I noticed that if I tried to mount a file system with -o degraded after having done it once already we would fail to mount. This is because the fs_devices->missing count was getting bumped everytime we mounted, but not getting reset whenever we unmounted. To fix this we just drop the missing count as we're closing devices to make sure this doesn't happen. Thanks,

---
 fs/btrfs/volumes.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
fs/btrfs/volumes.c +2 -0
index 74614e3..f42e412 100644
@@ -673,6 +673,8 @@ static int __btrfs_close_devices(struct btrfs_fs_devices *fs_devices)
 
 		if (device->can_discard)
 			fs_devices->num_can_discard--;
+		if (device->missing)
+			fs_devices->missing_devices--;
 
 		new_device = btrfs_alloc_device(NULL, &device->devid,
 						device->uuid);
Signature · 1 line
1.7.7.6