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
F115634948: D29688.diff
Sat, Apr 26, 8:13 AM
Unknown Object (File)
Mon, Apr 21, 2:04 AM
Unknown Object (File)
Sun, Apr 20, 7:54 AM
Unknown Object (File)
Mar 16 2025, 4:22 AM
Unknown Object (File)
Mar 3 2025, 7:22 PM
Unknown Object (File)
Feb 25 2025, 10:13 AM
Unknown Object (File)
Feb 17 2025, 4:07 PM
Unknown Object (File)
Feb 10 2025, 9:56 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.