[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20121101173854.62061307@notabene.brown>
Date: Thu, 1 Nov 2012 17:38:54 +1100
From: NeilBrown <neilb@...e.de>
To: Shaohua Li <shli@...nel.org>
Cc: linux RAID <linux-raid@...r.kernel.org>,
Jens Axboe <axboe@...nel.dk>,
lkml <linux-kernel@...r.kernel.org>
Subject: Problem with DISCARD and RAID5
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().
Could you look into this please?
Thanks,
NeilBrown
Download attachment "signature.asc" of type "application/pgp-signature" (829 bytes)
Powered by blists - more mailing lists