Skip to content

Block hotplug is accidentally quadratic #2

@nwf

Description

@nwf

The cache_load call in mount_action ignores the device name parameter:

fstools/block.c

Line 1256 in bfe882d

cache_load(1);

As such, each hotplug event (specifically, each /sbin/block hotplug invoked via /etc/hotplug.d/block/10-mount via /sbin/hotplug-call through the machinations of /etc/hotplug.json) probes all the block devices named here:

fstools/block.c

Lines 580 to 596 in bfe882d

static void cache_load(int mtd)
{
if (mtd) {
_cache_load("/dev/mtdblock*");
_cache_load("/dev/ubiblock*");
_cache_load("/dev/ubi[0-9]*");
}
_cache_load("/dev/loop*");
_cache_load("/dev/mmcblk*");
_cache_load("/dev/sd*");
_cache_load("/dev/hd*");
_cache_load("/dev/md*");
_cache_load("/dev/nvme*");
_cache_load("/dev/vd*");
_cache_load("/dev/xvd*");
_cache_load("/dev/dm-*");
}

That's rather a lot, if not all, of the block devices on the system, making the total block hotplug sequence accidentally quadratic.

I hope this is the right place to raise this issue, and I've also documented a bit about how I found this over in this forum thread, but if it belongs somewhere else, please let me know.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions