]> git.baikalelectronics.ru Git - kernel.git/commit
[SCSI] libfc: fix: rport_recv_req needs disc_mutex when calling rport_lookup
authorJoe Eykholt <jeykholt@cisco.com>
Tue, 25 Aug 2009 21:03:15 +0000 (14:03 -0700)
committerJames Bottomley <James.Bottomley@suse.de>
Thu, 10 Sep 2009 17:07:59 +0000 (12:07 -0500)
commitf3e4408bdc39c441262fe935f2d54d62459fc246
treed1b07c6ef9fc1b659056315b4ac95de27c9d0bd9
parent2a8ab21339c810dd7601bdb1d75e6cd783fed592
[SCSI] libfc: fix: rport_recv_req needs disc_mutex when calling rport_lookup

The rport_lookup function must be called while holding the disc_mutex.
Otherwise, the rdata could be deleted just after that by another thread.

All callers now check the state after grabbing the rdata rp_mutex.
Even though rport_lookup skips ports in DELETE state, it does that
without holding the rdata rp_mutex, so that the state may change.

Signed-off-by: Joe Eykholt <jeykholt@cisco.com>
Signed-off-by: Robert Love <robert.w.love@intel.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
drivers/scsi/libfc/fc_rport.c