HomeFreeBSD

ctld: if adding a target fails, retry it on the next reload

Description

ctld: if adding a target fails, retry it on the next reload

If the admin creates more CTL ports than kern.cam.ctl.max_ports, then
adding some will fail. If he then removes some ports and does
"service ctld reload", he would expect that the new ports would get
added in the newly-freed port space. But they don't, because ctld
assigned them port numbers during their first creation attempts.

Fix this bug by removing newly created ports from ctld's internal list
if the kernel rejects them for any reason. That way, a subsequent
config reload will attempt to add them again, possibly with new port
numbers.

MFC after: 2 weeks
Sponsored by: Axcient
Reviewed by: jhb, mav
Differential Revision: https://reviews.freebsd.org/D36974

Details

Provenance
asomersAuthored on Oct 12 2022, 10:44 PM
Reviewer
jhb
Differential Revision
D36974: ctld: if adding a target fails, retry it on the next reload
Parents
rG787df454c817: stabd/geli: Bail out if you can't get the disks size
Branches
Unknown
Tags
Unknown