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:	Fri, 2 Nov 2012 09:40:58 +0800
From:	Shaohua Li <shli@...nel.org>
To:	NeilBrown <neilb@...e.de>
Cc:	linux RAID <linux-raid@...r.kernel.org>,
	Jens Axboe <axboe@...nel.dk>,
	lkml <linux-kernel@...r.kernel.org>
Subject: Re: Problem with DISCARD and RAID5

On Thu, Nov 01, 2012 at 05:38:54PM +1100, NeilBrown wrote:
> 
> Hi Shaohua,
>  I've been doing some testing and discovered a problem with your discard
>  support for RAID5.
> 
>  The code in blkdev_issue_discard assumes that the 'granularity' is a power
>  of 2, and for example subtracts 1 to get a mask.
> 
>  However RAID5 sets the granularity to be the stripe size which often is not
>  a power of two.  When this happens you can easily get into an infinite loop.
> 
>  I suspect that to make this work properly, blkdev_issue_discard will need to
>  be changed to allow 'granularity' to be an arbitrary value.
>  When it is a power of two, the current masking can be used.
>  When it is anything else, it will need to use sector_div().

Yep, looks we need use sector_div. And this isn't the only problem. discard
request can be merged, and the merge check only checks max_discard_sectors.
That means the split requests in blkdev_issue_discard can be merged again. The
split nerver works.

I'm wondering what's purpose of discard_alignment and discard_granularity. Are
there devices with discard_granularity not 1 sector? If bio isn't discard
aligned, what device will do? Further, why driver handles alignment/granularity
if device will ignore misaligned request. Jens, can you share some hints please?

Thanks,
Shaohua
--
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