HomeFreeBSD

ctladm: Fix a race when loading ctl.ko

Description

ctladm: Fix a race when loading ctl.ko

If multiple ctladm processes try to load ctl.ko at the same time, only
one will succeed. Handle this possibility by retrying the operation
(open /dev/cam/ctl) if kldload returns EEXIST, rather than bailing.
This at least helps ensure that ctladm tests can be run in parallel
when ctl.ko is not preloaded.

Reviewed by: asomers
MFC after: 1 week

Details

Provenance
markjAuthored on Jun 24 2024, 3:09 PM
Parents
rGf29bdea04776: ext4_ext_tree_init: correct memset initialization
Branches
Unknown
Tags
Unknown