Page MenuHomeFreeBSD

iscsi: Kick threads out of iscsi_ioctl() during unload.
ClosedPublic

Authored by jhb on Apr 10 2021, 12:00 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Nov 9, 5:33 AM
Unknown Object (File)
Tue, Oct 28, 9:02 PM
Unknown Object (File)
Sun, Oct 26, 4:25 PM
Unknown Object (File)
Sun, Oct 19, 4:00 AM
Unknown Object (File)
Tue, Oct 14, 10:15 PM
Unknown Object (File)
Tue, Oct 14, 10:15 PM
Unknown Object (File)
Tue, Oct 14, 10:15 PM
Unknown Object (File)
Tue, Oct 14, 1:07 PM
Subscribers

Details

Summary

iscsid can be sleeping in iscsi_ioctl() causing the destroy_dev() to
sleep forever if iscsi.ko is unloaded while iscsid is running.

Reported by: Jithesh Arakkan @ Chelsio
MFC after: 1 week
Sponsored by: Chelsio Communications

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 38476
Build 35365: arc lint + arc unit

Event Timeline

jhb requested review of this revision.Apr 10 2021, 12:00 AM

To reproduce, just kldunload iscsi while iscsid is running. The kldunload will hang in "devdrn" inside of destroy_dev().

This revision is now accepted and ready to land.Apr 10 2021, 4:28 PM
sys/dev/iscsi/iscsi.c
2572

This looks fine. But... how do we ensure that all the threads are out of the ioctl handler before we return from here?

sys/dev/iscsi/iscsi.c
2572

This looks fine. But... how do we ensure that all the threads are out of the ioctl handler before we return from here?

destroy_dev() below makes sure of that.