diff -urN LVM2/lib/filters/filter.c LVM2.work/lib/filters/filter.c --- LVM2/lib/filters/filter.c 2004-03-28 11:25:44.000000000 +0200 +++ LVM2.work/lib/filters/filter.c 2004-03-31 09:44:02.000000000 +0200 @@ -64,7 +65,7 @@ static int _passes_lvm_type_device_filter(struct dev_filter *f, struct device *dev) { - int fd; + uint64_t size = 0; const char *name = dev_name(dev); /* Is this a recognised device type? */ @@ -74,15 +75,13 @@ return 0; } - /* Check it's accessible */ - if ((fd = open(name, O_RDONLY)) < 0) { - log_debug("%s: Skipping: open failed: %s", name, - strerror(errno)); + /* Check it's accessible and not empty */ + dev_get_size(dev, &size); + if (size == 0) { + log_debug("%s: Skipping: Cannot open or empty", name); return 0; } - close(fd); - return 1; }