提交 1031be7a 编写于 作者: N NeilBrown 提交者: Linus Torvalds

[PATCH] md: make sure the events count in an md array never returns to zero

Now that we sometimes step the array events count backwards (when
transitioning dirty->clean where nothing else interesting has happened - so
that we don't need to write to spares all the time), it is possible for the
event count to return to zero, which is potentially confusing and triggers and
MD_BUG.

We could possibly remove the MD_BUG, but is just as easy, and probably safer,
to make sure we never return to zero.
Signed-off-by: NNeil Brown <neilb@suse.de>
Signed-off-by: NAndrew Morton <akpm@osdl.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 3eda22d1
......@@ -1633,7 +1633,8 @@ static void md_update_sb(mddev_t * mddev, int force_change)
* and 'events' is odd, we can roll back to the previous clean state */
if (nospares
&& (mddev->in_sync && mddev->recovery_cp == MaxSector)
&& (mddev->events & 1))
&& (mddev->events & 1)
&& mddev->events != 1)
mddev->events--;
else {
/* otherwise we have to go forward and ... */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册