scsi_transport_fc: remove invalid BUG_ON
authorMichael Reed <mdr@sgi.com>
Fri, 9 Oct 2009 19:15:59 +0000 (14:15 -0500)
committerGreg Kroah-Hartman <gregkh@suse.de>
Thu, 28 Jan 2010 23:01:23 +0000 (15:01 -0800)
commit4b2bc96c3aa79b5d39be8ddbf903b7d19c701d88
tree587a30b0b497354ab2b737798b0029c2bd3a9ded
parentd502a766937129c5965bc88b8740a9362b9b263b
scsi_transport_fc: remove invalid BUG_ON

commit 8798a694da59486e4a3ff0abeec183202fb34c20 upstream.

I was doing some large lun count testing with 2.6.31 and hit
a BUG_ON() in fc_timeout_deleted_rport(), and it seems like it
should have been just a matter of time before someone did.

It seems invalid to set port_state under lock, then expect it to
remain set after releasing the lock.  Another thread called
fc_remote_port_add() when the lock was released, changing the
port_state.

This patch removes the BUG_ON and moves the test of the
port_state to inside the host_lock.  It's been running for
several weeks now with no ill effect.

Signed-off-by: Michael Reed <mdr@sgi.com>
Acked-by: James Smart <james.smart@emulex.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/scsi/scsi_transport_fc.c