diff options
author | Arne Jansen <sensille@gmx.net> | 2011-05-30 04:36:16 -0400 |
---|---|---|
committer | Chris Mason <chris.mason@oracle.com> | 2011-06-04 08:03:44 -0400 |
commit | 5f3f302a6f4cb74906c05fad1d03fc5e95c7e5af (patch) | |
tree | 224a59dcd31fbbe2b23ac85d3d4906bbf7327b78 /fs/btrfs | |
parent | ca456ae280c0646e1e571c3b9a3834c55e90adfe (diff) |
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>
Diffstat (limited to 'fs/btrfs')
-rw-r--r-- | fs/btrfs/volumes.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c index c48214ef5c09..da541dfca2e3 100644 --- a/fs/btrfs/volumes.c +++ b/fs/btrfs/volumes.c | |||
@@ -504,7 +504,7 @@ static int __btrfs_close_devices(struct btrfs_fs_devices *fs_devices) | |||
504 | BUG_ON(!new_device); | 504 | BUG_ON(!new_device); |
505 | memcpy(new_device, device, sizeof(*new_device)); | 505 | memcpy(new_device, device, sizeof(*new_device)); |
506 | new_device->name = kstrdup(device->name, GFP_NOFS); | 506 | new_device->name = kstrdup(device->name, GFP_NOFS); |
507 | BUG_ON(!new_device->name); | 507 | BUG_ON(device->name && !new_device->name); |
508 | new_device->bdev = NULL; | 508 | new_device->bdev = NULL; |
509 | new_device->writeable = 0; | 509 | new_device->writeable = 0; |
510 | new_device->in_fs_metadata = 0; | 510 | new_device->in_fs_metadata = 0; |