lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Thu, 30 Mar 2017 12:13:11 +0800
From:   Fam Zheng <famz@...hat.com>
To:     "Martin K. Petersen" <martin.petersen@...cle.com>
Cc:     linux-kernel@...r.kernel.org, linux-scsi@...r.kernel.org,
        Laurence Oberman <loberman@...hat.com>,
        "James E.J. Bottomley" <jejb@...ux.vnet.ibm.com>
Subject: Re: [PATCH v2] sd: Consider max_xfer_blocks if opt_xfer_blocks is
 unusable

On Wed, 03/29 22:37, Martin K. Petersen wrote:
> Fam Zheng <famz@...hat.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);

Yes, it is better. Is it okay to make the change when you apply?

Fam

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ