linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Problem with DISCARD and RAID5
@ 2012-11-01  6:38 NeilBrown
  2012-11-02  1:40 ` Shaohua Li
  0 siblings, 1 reply; 5+ messages in thread
From: NeilBrown @ 2012-11-01  6:38 UTC (permalink / raw)
  To: Shaohua Li; +Cc: linux RAID, Jens Axboe, lkml

[-- Attachment #1: Type: text/plain, Size: 725 bytes --]


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

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 828 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2012-11-07  5:02 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-11-01  6:38 Problem with DISCARD and RAID5 NeilBrown
2012-11-02  1:40 ` Shaohua Li
2012-11-05 21:48   ` Dave Chinner
2012-11-06  8:06     ` Jens Axboe
2012-11-07  5:02       ` Shaohua Li

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).