scsi: libfc: fix a deadlock in fc_rport_work
authorSatish Kharat <satishkh@cisco.com>
Thu, 5 Oct 2017 23:41:21 +0000 (16:41 -0700)
committerMartin K. Petersen <martin.petersen@oracle.com>
Fri, 6 Oct 2017 18:58:22 +0000 (14:58 -0400)
commitd1b3f51ee1eab3a6db1b09a60e61280c48eb0b01
tree2a116964644a176e41fd8e86f98ea59d0b18b803
parentfbce4d97fd4333bcffd00a73b9d98412be630332
scsi: libfc: fix a deadlock in fc_rport_work

In places like fc_rport_recv_plogi_req and fcoe_ctlr_vn_add we always
take the lport disc_mutex lock before the rports mutex
(rp_mutex) lock. Gaurding list_del_rcu(&rdata->peers) with
disc.disc_mutex in fc_rport_work is correct but the rp_mutex lock
can and should to be dropped before taking that lock else results
in a deadlock.

Signed-off-by: Satish Kharat <satishkh@cisco.com>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/libfc/fc_rport.c