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)
Sat, Jan 18, 11:05 PM
Unknown Object (File)
Dec 5 2024, 9:40 PM
Unknown Object (File)
Oct 27 2024, 11:12 AM
Unknown Object (File)
Oct 27 2024, 11:12 AM
Unknown Object (File)
Oct 27 2024, 11:12 AM
Unknown Object (File)
Oct 27 2024, 10:53 AM
Unknown Object (File)
Oct 2 2024, 10:14 PM
Unknown Object (File)
Sep 15 2024, 9:20 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.