From 785bfe3923f9dbc71e6e316d3c27afed5fbcf6d4 Mon Sep 17 00:00:00 2001 From: Liu Bo Date: Sat, 22 Jun 2013 13:32:42 +0800 Subject: Btrfs-progs: skip open devices which is missing A device can be added to the device list without getting a name, so we may access to illegal addresses while opening devices with their name. Signed-off-by: Liu Bo Signed-off-by: Chris Mason --- volumes.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'volumes.c') diff --git a/volumes.c b/volumes.c index d6f81f87..013bfd5a 100644 --- a/volumes.c +++ b/volumes.c @@ -186,6 +186,10 @@ int btrfs_open_devices(struct btrfs_fs_devices *fs_devices, int flags) list_for_each(cur, head) { device = list_entry(cur, struct btrfs_device, dev_list); + if (!device->name) { + printk("no name for device %llu, skip it now\n", device->devid); + continue; + } fd = open(device->name, flags); if (fd < 0) { -- cgit v1.2.3