Thread (10 messages) 10 messages, 2 authors, 2021-07-28
STALE1818d
Revisions (3)
  1. v1 current
  2. v3 [diff vs current]
  3. v4 [diff vs current]

[PATCH 1/6] btrfs: do not check for ->num_devices == 0 in rm_device

From: Josef Bacik <josef@toxicpanda.com>
Date: 2021-07-27 19:47:55
Subsystem: btrfs file system, filesystems (vfs and infrastructure), the rest · Maintainers: Chris Mason, David Sterba, Alexander Viro, Christian Brauner, Linus Torvalds

We're specifically prohibited from removing the last device in a file
system, so this check is meaningless and the code can be deleted.

Signed-off-by: Josef Bacik <josef@toxicpanda.com>
---
 fs/btrfs/volumes.c | 7 -------
 1 file changed, 7 deletions(-)
diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c
index 86846d6e58d0..373be4e54f28 100644
--- a/fs/btrfs/volumes.c
+++ b/fs/btrfs/volumes.c
@@ -2199,13 +2199,6 @@ int btrfs_rm_device(struct btrfs_fs_info *fs_info, const char *device_path,
 	btrfs_close_bdev(device);
 	synchronize_rcu();
 	btrfs_free_device(device);
-
-	if (cur_devices->open_devices == 0) {
-		list_del_init(&cur_devices->seed_list);
-		close_fs_devices(cur_devices);
-		free_fs_devices(cur_devices);
-	}
-
 out:
 	mutex_unlock(&uuid_mutex);
 	return ret;
-- 
2.26.3
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help