mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 11:11:45 -04:00
md: fix calculation of stacking limits on level change.
The various ->run routines of md personalities assume that the 'queue' has been initialised by the blk_set_stacking_limits() call in md_alloc(). 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 settings. 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 RAID0. This is suitable for any -stable kernel since 3.3 in which blk_set_stacking_limits() was introduced. Cc: [email protected] (3.3+) Reported-and-tested-by: "Baldysiak, Pawel" <[email protected]> Signed-off-by: NeilBrown <[email protected]>
This commit is contained in:
parent
ad4068de49
commit
02e5f5c0a0
1 changed files with 1 additions and 0 deletions
|
|
@ -3620,6 +3620,7 @@ level_store(struct mddev *mddev, const char *buf, size_t len)
|
|||
mddev->in_sync = 1;
|
||||
del_timer_sync(&mddev->safemode_timer);
|
||||
}
|
||||
blk_set_stacking_limits(&mddev->queue->limits);
|
||||
pers->run(mddev);
|
||||
set_bit(MD_CHANGE_DEVS, &mddev->flags);
|
||||
mddev_resume(mddev);
|
||||
|
|
|
|||
Loading…
Reference in a new issue