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)
May 20 2024, 9:02 PM
Unknown Object (File)
May 8 2024, 9:50 PM
Unknown Object (File)
Apr 12 2024, 8:15 AM
Unknown Object (File)
Apr 10 2024, 8:54 PM
Unknown Object (File)
Apr 4 2024, 3:09 PM
Unknown Object (File)
Mar 10 2024, 8:47 PM
Unknown Object (File)
Jan 13 2024, 1:30 PM
Unknown Object (File)
Jan 8 2024, 10:25 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.