IB/iser: Fix max_sectors calculation
authorChristoph Hellwig <hch@lst.de>
Mon, 18 Apr 2016 21:06:28 +0000 (17:06 -0400)
committerDoug Ledford <dledford@redhat.com>
Thu, 5 May 2016 16:41:24 +0000 (12:41 -0400)
commit9c674815d346305068b27bf03b5e86b659a1b111
treeb512f798dbdfb99a3cfb7ca971b04fc5c52a9000
parent4c8bb95921e9ac01b9dd0c3abbaf6514ce88af92
IB/iser: Fix max_sectors calculation

iSER currently has a couple places that set max_sectors in either the host
template or SCSI host, and all of them get it wrong.

This patch instead uses a single assignment that (hopefully) gets it right:
the max_sectors value must be derived from the number of segments in the
FR or FMR structure, but actually be one lower than the page size multiplied
by the number of sectors, as it has to handle the case of non-aligned I/O.

Without this I get trivial to reproduce hangs when running xfstests
(on XFS) over iSER to Linux targets.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Max Gurtovoy <maxg@mellanox.com>
Acked-by: Sagi Grimberg <sagi@grimberg.me>
Signed-off-by: Doug Ledford <dledford@redhat.com>
drivers/infiniband/ulp/iser/iscsi_iser.c
This page took 0.024815 seconds and 5 git commands to generate.