[lkml]   [2013]   [Dec]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Patch in this message
Subject[PATCH 3.12 146/212] md: fix calculation of stacking limits on level change.
3.12-stable review patch.  If anyone has any objections, please let me know.


From: NeilBrown <>

commit 02e5f5c0a0f726e66e3d8506ea1691e344277969 upstream.

The various ->run routines of md personalities assume that the 'queue'
has been initialised by the blk_set_stacking_limits() call in

However when the level is changed (by level_store()) the ->run routine
for the new level is called for an array which has already had the
stacking limits modified. This can result in incorrect final

So call blk_set_stacking_limits() before ->run in level_store().

A specific consequence of this bug is that it causes
discard_granularity to be set incorrectly when reshaping a RAID4 to a

This is suitable for any -stable kernel since 3.3 in which
blk_set_stacking_limits() was introduced.

Reported-and-tested-by: "Baldysiak, Pawel" <>
Signed-off-by: NeilBrown <>
Signed-off-by: Greg Kroah-Hartman <>

drivers/md/md.c | 1 +
1 file changed, 1 insertion(+)

--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -3620,6 +3620,7 @@ level_store(struct mddev *mddev, const c
mddev->in_sync = 1;
+ blk_set_stacking_limits(&mddev->queue->limits);
set_bit(MD_CHANGE_DEVS, &mddev->flags);

 \ /
  Last update: 2013-12-02 21:01    [W:0.409 / U:6.044 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site