bnx2fc: timeout calculation invalid for bnx2fc_eh_abort()
Subsystems (2)
PATCH 1/1 bnx2fc: timeout calculation invalid for bnx2fc_eh_abort()
In the bnx2fc_eh_abort() function there is a calculation for wait_for_completion that uses a HZ multiplier. This is incorrect, it scales the timeout by 1000 seconds instead of converting the ms value to jiffies. Therefore change the calculation.
--- drivers/scsi/bnx2fc/bnx2fc_io.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/scsi/bnx2fc/bnx2fc_io.c +1 -1
@@ -1242,7 +1242,7 @@ int bnx2fc_eh_abort(struct scsi_cmnd *sc_cmd)/* Wait 2 * RA_TOV + 1 to be sure timeout function hasn't fired */ time_left =wait_for_completion_timeout (&io_req->abts_done, - (2 * rp->r_a_tov +1 ) *HZ ); +msecs_to_jiffies (2 * rp->r_a_tov +1 ));if (time_left)BNX2FC_IO_DBG (io_req,"Timed out in eh_abort waiting for abts_done" );
Signature · 1 line
1.8.3.1
Looks like the original calculation assumed that rp->r_a_tov was specified in seconds hence the HZ multiplier. Converting using msecs_to_jiffies() would seem to be the correct way to do it.
Quoted 31 lines · Laurence Oberman
In the
bnx2fc_eh_abort()function there is a calculation forwait_for_completionthat uses a HZ multiplier. This is incorrect, it scales the timeout by 1000 seconds instead of converting the ms value to jiffies. Therefore change the calculation.Reported-by David Jeffery <[email protected]>Reviewed-by John Pittman [email protected]>Signed-off-by Laurence Oberman <[email protected]>--- drivers/scsi/bnx2fc/bnx2fc_io.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/scsi/bnx2fc/bnx2fc_io.c +1
-1@@ -1242,7 +1242,7 @@ int bnx2fc_eh_abort(struct scsi_cmnd *sc_cmd)/* Wait 2 * RA_TOV + 1 to be sure timeout function hasn't fired */ time_left =wait_for_completion_timeout (&io_req->abts_done, - (2 * rp->r_a_tov +1 ) *HZ ); +msecs_to_jiffies (2 * rp- >r_a_tov + 1));drivers/scsi/bnx2fc/bnx2fc_io.c +0
-0if (time_left) BNX2FC_IO_DBG(io_req, "Timed out in eh_abort waiting for
abts_done");
Martin K. Petersen
AppliedLaurence,
Quoted 4 lines
In the
bnx2fc_eh_abort()function there is a calculation forwait_for_completionthat uses a HZ multiplier. This is incorrect, it scales the timeout by 1000 seconds instead of converting the ms value to jiffies. Therefore change the calculation.
Applied to 5.5/scsi-queue, thanks!
Signature · 1 line
Martin K. Petersen Oracle Linux Engineering