Remove now unnecessary kldstat check before attempting to load modules.
Since r233109, kldload has the -n option, which silently ignores options
that are already loaded.
https://lists.freebsd.org/pipermail/freebsd-rc/2018-December/003899.html
Differential D18670
Minor speedup for load_kld function crees on Dec 28 2018, 2:55 PM. Authored by Tags None Referenced Files
Details Remove now unnecessary kldstat check before attempting to load modules. Since r233109, kldload has the -n option, which silently ignores options https://lists.freebsd.org/pipermail/freebsd-rc/2018-December/003899.html [crees@pegasus]~/workspace/src/head% sudo sh # . libexec/rc/rc.subr # kldstat |grep cuse # load_kld cuse4bsd # kldstat |grep cuse 15 1 0xffffffff818c3000 40a0 cuse.ko # load_kld cuse4bsd # load_kld doesntexist kldload: can't load doesntexist: No such file or directory sh: WARNING: Unable to load kernel module doesntexist # kldunload cuse # load_kld -m nothing -e noop /boot/modules/cuse4bsd.ko # kldstat |grep cuse 15 1 0xffffffff818c3000 4c80 cuse4bsd.ko # load_kld -m nothing -e noop /boot/modules/cuse4bsd.ko # load_kld -m nothing -e noop /boot/modules/cuse4bsd.ko # load_kld -m nothing -e noop /boot/modules/cuse4bsd.ko # kldstat |grep cuse 15 1 0xffffffff818c3000 4c80 cuse4bsd.ko #
Diff Detail
Event Timeline
Comment Actions I've reverted the patch for now (thanks again Jilles for your approval). If the zfs.ko module is loaded, a zfs module exists in the kernel, but I suspect that zfs doesn't exist in a kernel with it compiled in; only zfsctrl, based on what avg has suggested (Andriy, hope you don't mind me subscribing you). I think that changing required_modules to zfsctrl in the zfs script should fix this, but I'll need to verify that before trying to commit again, as well as verify that zfs.ko is loaded if it doesn't. Comment Actions Once again, you are confusing a name of a loadable file with a name of a module. Which is not surprising as that duality is confusing. E.g., a single loadable file can contains multiple modules. Comment Actions Thanks very much for the explanation-- I think my terminology is just off here (I do understand what you mean). I have some ideas to get this to work, but I'll get back when I've tried them, may not be for a few days. Comment Actions I don't think the upheaval or risk of further bugs is worth this-- the code works as-is right now. |