[Bug 261387] Should cam be calling callout drain for struct cam_sim and struct cam_ed?

From: <bugzilla-noreply_at_freebsd.org>
Date: Fri, 28 Jan 2022 15:38:09 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=261387

--- Comment #3 from Mark Johnston <markj@FreeBSD.org> ---
(In reply to Herbie.Robinson from comment #2)
"theoretical" was a bad word choice.  I don't mean that this becomes a problem
with sufficiently large timing delays or anything like that.  (At least, I
can't see how it does.)  Rather, this code seemingly violates the implicit
contract that consumers have with the callout subsystem, that callout
structures shouldn't be freed while the callout handler is running.  In fact, I
believe this is safe to do in this particular case.  softclock_call_cc(), the
function that actually invokes the callout handler, does not access the callout
structure after calling the handler except in two cases which do not apply to
the cam_ed callout.

So while it's formally correct to drain the callout before destroying the
device in cam_destroy_device(), I can't see how it would fix any observed
problems.  To be clear, I don't disagree with the patch.

-- 
You are receiving this mail because:
You are the assignee for the bug.