Re: [PATCH] sd: Consider max_xfer_blocks if opt_xfer_blocks is unusable

2017-03-27 Thread Martin K. Petersen
Fam Zheng writes: Hi Fam, > --- a/drivers/scsi/sd.c > +++ b/drivers/scsi/sd.c > @@ -2957,6 +2957,7 @@ static int sd_revalidate_disk(struct gendisk *disk) > rw_max = logical_to_sectors(sdp, sdkp->opt_xfer_blocks); > } else > rw_max = BLK_DEF_MAX_SECTORS; > +

Re: [PATCH] sd: Consider max_xfer_blocks if opt_xfer_blocks is unusable

2017-03-27 Thread Laurence Oberman
- Original Message - > From: "Fam Zheng" > To: linux-kernel@vger.kernel.org > Cc: "Martin K. Petersen" , f...@redhat.com, > linux-s...@vger.kernel.org, "James E.J. > Bottomley" > Sent: Monday, March 27, 2017 10:18:31 AM &g

[PATCH] sd: Consider max_xfer_blocks if opt_xfer_blocks is unusable

2017-03-27 Thread Fam Zheng
If device reports a small max_xfer_blocks and a zero opt_xfer_blocks, we end up using BLK_DEF_MAX_SECTORS, which is wrong and r/w of that size may get error. Fixes: ca369d51b3e ("block/sd: Fix device-imposed transfer length limits") Signed-off-by: Fam Zheng --- drivers/scsi/sd.c | 1 + 1 file ch