]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
scsi: libfc: sanitize E_D_TOV and R_A_TOV setting
authorHannes Reinecke <hare@suse.de>
Thu, 13 Oct 2016 13:10:41 +0000 (15:10 +0200)
committerBrian Maly <brian.maly@oracle.com>
Sun, 12 May 2019 01:53:30 +0000 (21:53 -0400)
When setting the FCP timeout we need to ensure a lower boundary
for E_D_TOV and R_A_TOV, otherwise we'd be getting spurious I/O
issues due to the fcp timer firing too early.

Orabug: 25933179

Reviewed-by: John Sobecki <john.sobecki@oracle.com>
Signed-off-by: Hannes Reinecke <hare@suse.com>
Acked-by: Johannes Thumshirn <jth@kernel.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Rajan Shanmugavelu <rajan.shanmugavelu@oracle.com>
Signed-off-by: Brian Maly <brian.maly@oracle.com>
drivers/scsi/libfc/fc_rport.c

index bb7e9d9a31790fee8de85c1ba6fa61fdbad638ba..3d2baba4103e69bf04c32d25de562765cbe5e015 100644 (file)
@@ -1296,13 +1296,15 @@ static void fc_rport_rtv_resp(struct fc_seq *sp, struct fc_frame *fp,
                        tov = ntohl(rtv->rtv_r_a_tov);
                        if (tov == 0)
                                tov = 1;
-                       rdata->r_a_tov = tov;
+                       if (tov > rdata->r_a_tov)
+                               rdata->r_a_tov = tov;
                        tov = ntohl(rtv->rtv_e_d_tov);
                        if (toq & FC_ELS_RTV_EDRES)
                                tov /= 1000000;
                        if (tov == 0)
                                tov = 1;
-                       rdata->e_d_tov = tov;
+                       if (tov > rdata->e_d_tov)
+                               rdata->e_d_tov = tov;
                }
        }