You've already forked linux-apfs
mirror of
https://github.com/linux-apfs/linux-apfs.git
synced 2026-05-01 15:00:59 -07:00
btrfs: false BUG_ON when degraded
In degraded mode the struct btrfs_device of missing devs don't have device->name set. A kstrdup of NULL correctly returns NULL. Don't BUG in this case. Signed-off-by: Arne Jansen <sensille@gmx.net> Signed-off-by: Chris Mason <chris.mason@oracle.com>
This commit is contained in:
+1
-1
@@ -504,7 +504,7 @@ static int __btrfs_close_devices(struct btrfs_fs_devices *fs_devices)
|
||||
BUG_ON(!new_device);
|
||||
memcpy(new_device, device, sizeof(*new_device));
|
||||
new_device->name = kstrdup(device->name, GFP_NOFS);
|
||||
BUG_ON(!new_device->name);
|
||||
BUG_ON(device->name && !new_device->name);
|
||||
new_device->bdev = NULL;
|
||||
new_device->writeable = 0;
|
||||
new_device->in_fs_metadata = 0;
|
||||
|
||||
Reference in New Issue
Block a user