From: Hannes Reinecke Date: Thu, 13 Oct 2016 13:10:41 +0000 (+0200) Subject: scsi: libfc: sanitize E_D_TOV and R_A_TOV setting X-Git-Tag: v4.1.12-124.31.3~125 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=bbae5db07b75a8d45ce5de767018d45b33c8a8f5;p=users%2Fjedix%2Flinux-maple.git scsi: libfc: sanitize E_D_TOV and R_A_TOV setting 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 Signed-off-by: Hannes Reinecke Acked-by: Johannes Thumshirn Signed-off-by: Martin K. Petersen Signed-off-by: Rajan Shanmugavelu Signed-off-by: Brian Maly --- diff --git a/drivers/scsi/libfc/fc_rport.c b/drivers/scsi/libfc/fc_rport.c index bb7e9d9a3179..3d2baba4103e 100644 --- a/drivers/scsi/libfc/fc_rport.c +++ b/drivers/scsi/libfc/fc_rport.c @@ -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; } }