OSDN Git Service

scsi: libfc: hold disc_mutex in fc_disc_stop_rports()
authorHannes Reinecke <hare@suse.de>
Wed, 11 Jul 2018 08:09:28 +0000 (10:09 +0200)
committerMartin K. Petersen <martin.petersen@oracle.com>
Fri, 13 Jul 2018 03:01:16 +0000 (23:01 -0400)
commitbc3d12b75491c0e844a8a7ce05e84de8f7d94822
treef9c4a04f23c7f53692304362cb56aa38dc275785
parent9a26653b9525c08bc3d0a2c5c65721e4de3a5f6d
scsi: libfc: hold disc_mutex in fc_disc_stop_rports()

fc_disc_stop_rports() is calling fc_rport_logoff(), which in turn is
acquiring the rport mutex. So we cannot use RCU list traversal here, but
rather need to hold the disc mutex to avoid list corruption while
traversing.

Fixes: a407c593398c ("scsi: libfc: Fixup disc_mutex handling")
Signed-off-by: Hannes Reinecke <hare@suse.com>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/libfc/fc_disc.c