On Sat, 6 Sep 2014 13:48:09 +0200, Goffredo Baroncelli wrote:
> On 09/03/2014 03:36 PM, Miao Xie wrote:
>> The original code need scan the devices and build the fs device list by the user
>> tool by udev or users' selves. It is flexible. But if someone re-install the
>> filesystem module, and forget to scan the devices by himself, or we plug some
>> devices with btrfs, but udev thread is blocked and doesn't register the disk
>> into btrfs in time, the filesystem would report that "can not open some device"
>> when mounting the filesystem, it was uncomfortable, this patch fixes this problem
>> by scanning all the devices if we find the number of devices is not right when
>> we mount the filesystem.
>>
>> Signed-off-by: Miao Xie <miaox@xxxxxxxxxxxxxx>
> [....]
>> +
>> +void btrfs_scan_all_devices(void *holder)
>> +{
>> + struct class_dev_iter iter;
>> + struct device *dev;
>> + struct gendisk *disk;
>> +
>> + mutex_lock(&uuid_mutex);
>> + class_dev_iter_init(&iter, &block_class, NULL, &disk_type);
>> + while ((dev = class_dev_iter_next(&iter))) {
>> + disk = dev_to_disk(dev);
>> +
>> + if (!get_capacity(disk) ||
>> + (!disk_max_parts(disk) &&
>> + (disk->flags & GENHD_FL_REMOVABLE)))
> ^^^^^^^^^^^^^^^^^^
>> + continue;
>> +
>> + if (disk->flags & GENHD_FL_SUPPRESS_PARTITION_INFO)
>> + continue;
>
>
> Hi, could you elaborate why a removable disk should be not scan-ned ? How
> a removble usb disk is classified ?
This is used to filter the non-partitionable removeable device such as cdrom,
if it is a usb disk, it should be partitionable.
Thanks
Miao
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html