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] [day] [month] [year] [list]
Date:	Wed, 27 Nov 2013 13:34:51 -0800
From:	Kent Overstreet <kmo@...erainc.com>
To:	Christoph Hellwig <hch@...radead.org>
Cc:	linux-kernel@...r.kernel.org, linux-fsdevel@...r.kernel.org,
	axboe@...nel.dk
Subject: Re: [PATCH 4/5] blk-lib.c: generic_make_request() handles large bios
 now

On Wed, Nov 27, 2013 at 04:54:05AM -0800, Christoph Hellwig wrote:
> >  int blkdev_issue_discard(struct block_device *bdev, sector_t sector,
> >  		sector_t nr_sects, gfp_t gfp_mask, unsigned long flags)
> >  {
> > -	DECLARE_COMPLETION_ONSTACK(wait);
> >  	struct request_queue *q = bdev_get_queue(bdev);
> >  	int type = REQ_WRITE | REQ_DISCARD;
> > -	unsigned int max_discard_sectors, granularity;
> > -	int alignment;
> > -	struct bio_batch bb;
> >  	struct bio *bio;
> >  	int ret = 0;
> > -	struct blk_plug plug;
> >  
> >  	if (!q)
> >  		return -ENXIO;
> > @@ -56,78 +34,28 @@ int blkdev_issue_discard(struct block_device *bdev, sector_t sector,
> >  	if (!blk_queue_discard(q))
> >  		return -EOPNOTSUPP;
> >  
> > -	/* Zero-sector (unknown) and one-sector granularities are the same.  */
> > -	granularity = max(q->limits.discard_granularity >> 9, 1U);
> > -	alignment = (bdev_discard_alignment(bdev) >> 9) % granularity;
> > -
> > -	/*
> > -	 * Ensure that max_discard_sectors is of the proper
> > -	 * granularity, so that requests stay aligned after a split.
> > -	 */
> > -	max_discard_sectors = min(q->limits.max_discard_sectors, UINT_MAX >> 9);
> > -	max_discard_sectors -= max_discard_sectors % granularity;
> 
> Seems like this is also missing the code to trim down the request to
> be properly aligned to the device limit.  I don't think our low-level
> drivers are ready to handle this, and even if they were it should be a
> separate change.

The previous patch added that - that was blk_bio_discard_split(), which you
commented on...
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ