[PATCH 2/3] libfc: only restart discovery after timeout if not already running

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



If a discovery is already running (ie if the 'pending' flags is set)
there is no need to restart discovery from the timeout handler.

Signed-off-by: Hannes Reinecke <hare@xxxxxxxx>
---
 drivers/scsi/libfc/fc_disc.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/scsi/libfc/fc_disc.c b/drivers/scsi/libfc/fc_disc.c
index 913beb5..82b1c97 100644
--- a/drivers/scsi/libfc/fc_disc.c
+++ b/drivers/scsi/libfc/fc_disc.c
@@ -503,10 +503,12 @@ static void fc_disc_timeout(struct work_struct *work)
 					    struct fc_disc,
 					    disc_work.work);
 	mutex_lock(&disc->disc_mutex);
-	disc->pending = 1;
-	disc->requested = 0;
+	if (!disc->pending) {
+		disc->pending = 1;
+		disc->requested = 0;
 
-	fc_disc_gpn_ft_req(disc);
+		fc_disc_gpn_ft_req(disc);
+	}
 	mutex_unlock(&disc->disc_mutex);
 }
 
-- 
1.8.5.6




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]

  Powered by Linux