lkml.org 
[lkml]   [2017]   [Mar]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH v2] sd: Consider max_xfer_blocks if opt_xfer_blocks is unusable
From
Date
Fam Zheng <famz@redhat.com> writes:

Fam,

> diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c
> index fcfeddc..a5c7e67 100644
> --- 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;
> + rw_max = min_not_zero(rw_max, logical_to_sectors(sdp, dev_max));
>
> /* Combine with controller limits */
> q->limits.max_sectors = min(rw_max, queue_max_hw_sectors(q));

Instead of updating rw_max twice, how about:

} else
rw_max = min_not_zero(logical_to_sectors(sdp, dev_max),
BLK_DEF_MAX_SECTORS);

?

--
Martin K. Petersen Oracle Linux Engineering

\
 
 \ /
  Last update: 2017-03-30 04:38    [W:0.062 / U:0.252 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site