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)
Mon, Sep 22, 8:28 PM
Unknown Object (File)
Fri, Sep 19, 7:46 AM
Unknown Object (File)
Sep 6 2025, 3:10 AM
Unknown Object (File)
Sep 3 2025, 4:54 AM
Unknown Object (File)
Aug 11 2025, 4:03 AM
Unknown Object (File)
Aug 5 2025, 3:06 AM
Unknown Object (File)
Aug 3 2025, 11:09 AM
Unknown Object (File)
Jul 27 2025, 7:31 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
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

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.