Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[SCSI] libfc: Handle discovery failure during ctlr link down

While we wait for GPN_FT response, if the ctlr link goes down, the stack
generates a completion for GPN_FT with error FC_EXCH_CLOSED, and reports a
discovery error. Discovery is not retried in this case, and rightly so.
However, the 'pending' flag stays set, which does not allow subsequent
discovery to succeed as GPN_FT will never be issued. Fix it by clearing the
pending flag when the discovery fails due to GPN_FT failure.

Signed-off-by: Bhanu Prakash Gollapudi <bprakash@broadcom.com>
Signed-off-by: Robert Love <robert.w.love@intel.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>

authored by

Bhanu Prakash Gollapudi and committed by
James Bottomley
00832084 d4042e9c

+7
+7
drivers/scsi/libfc/fc_disc.c
··· 337 337 schedule_delayed_work(&disc->disc_work, delay); 338 338 } else 339 339 fc_disc_done(disc, DISC_EV_FAILED); 340 + } else if (PTR_ERR(fp) == -FC_EX_CLOSED) { 341 + /* 342 + * if discovery fails due to lport reset, clear 343 + * pending flag so that subsequent discovery can 344 + * continue 345 + */ 346 + disc->pending = 0; 340 347 } 341 348 } 342 349