Page MenuHomeFreeBSD

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

Authored by jhb on Apr 10 2021, 12:00 AM.

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
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; 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
2571

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
2571

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.