From: NeilBrown Date: Wed, 27 Mar 2013 05:51:09 +0000 (+1100) Subject: md: don't update metadata when stopping a read-only array. X-Git-Tag: next-20130402~51^2~4 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=3b8fb1d91daacc6c15bc3240d73be074e074d50b;p=karo-tx-linux.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 491afda21fd9..30132280d07b 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);