From: NeilBrown Date: Wed, 24 Apr 2013 01:42:42 +0000 (+1000) Subject: md: don't update metadata when stopping a read-only array. X-Git-Tag: v3.10-rc6~16^2~9 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b6d428c669159b8cfa5a83bb11abaaf4bdc170b0;p=platform%2Fkernel%2Flinux-3.10.git md: don't update metadata when stopping a read-only array. read-only arrays should stay that way as much as possible. Updating the metadata - which could be triggered by a re-add while assembling the array metadata - should be avoided. Signed-off-by: NeilBrown --- diff --git a/drivers/md/md.c b/drivers/md/md.c index 491afda..3013228 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c @@ -5293,7 +5293,8 @@ static void __md_stop_writes(struct mddev *mddev) bitmap_flush(mddev); md_super_wait(mddev); - if (!mddev->in_sync || mddev->flags) { + if (mddev->ro == 0 && + (!mddev->in_sync || mddev->flags)) { /* mark array as shutdown cleanly */ mddev->in_sync = 1; md_update_sb(mddev, 1);