From: Joe Eykholt Date: Tue, 25 Aug 2009 21:02:38 +0000 (-0700) Subject: [SCSI] libfc: discovery retry should clear pending first. X-Git-Tag: firefly_0821_release~12969^2~39 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=3667d7e7f7bb63a394f73a671fdaf4a187aa858e;p=firefly-linux-kernel-4.4.55.git [SCSI] libfc: discovery retry should clear pending first. Currently fc_disc_timeout() restarts discovery only if it is not pending. When the timer is scheduled, the discovery is left pending, so the timeout never restarts it. Fix by not checking for pending in the timeout handler. If discovery is stopped and restarted in the meantime, the timeout will be canceled. Also, when a new discovery is started, the retry count wasn't cleared. Signed-off-by: Joe Eykholt Signed-off-by: Robert Love Signed-off-by: James Bottomley --- diff --git a/drivers/scsi/libfc/fc_disc.c b/drivers/scsi/libfc/fc_disc.c index 9b8043bdeddb..3efdbbab9b2b 100644 --- a/drivers/scsi/libfc/fc_disc.c +++ b/drivers/scsi/libfc/fc_disc.c @@ -233,6 +233,7 @@ static void fc_disc_restart(struct fc_disc *disc) * freshly-discovered remote ports. Avoid wrapping to zero. */ disc->disc_id = (disc->disc_id + 2) | 1; + disc->retry_count = 0; fc_disc_gpn_ft_req(disc); } @@ -563,8 +564,7 @@ static void fc_disc_timeout(struct work_struct *work) struct fc_disc, disc_work.work); mutex_lock(&disc->disc_mutex); - if (disc->requested && !disc->pending) - fc_disc_gpn_ft_req(disc); + fc_disc_gpn_ft_req(disc); mutex_unlock(&disc->disc_mutex); }