[SCSI] libfc: fc_rport_logoff should not drop the lock
authorJoe Eykholt <jeykholt@cisco.com>
Thu, 30 Jul 2009 00:04:49 +0000 (17:04 -0700)
committerJames Bottomley <James.Bottomley@suse.de>
Sat, 22 Aug 2009 22:52:06 +0000 (17:52 -0500)
commit5f7ea3b7f81d5e5180647a071998b73a841bdba9
tree29f974c9b6eb186e38f13fea8196c1107f2df738
parent141940548c6919c22bf0573c68fd59d961e22475
[SCSI] libfc: fc_rport_logoff should not drop the lock

fc_rport_logoff drops the rport lock in order to cancel work
that may be pending.  This is undesirable as the state can
completely change, and the caller may not expect that the
lock could've been dropped.

If there is work pending, it will acquire the rdata mutex and
so we're protected and can change the event from READY to DELETE.
Queue the work only if there is no event already pending.

There were a couple other cases where the state was set to
DELETE and work queued, even though the state may have already
been DELETE.  Fix these using a common function fc_rport_enter_delete().

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@HansenPartnership.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
drivers/scsi/libfc/fc_rport.c