]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
md: don't update metadata when stopping a read-only array.
authorNeilBrown <neilb@suse.de>
Wed, 27 Mar 2013 05:51:09 +0000 (16:51 +1100)
committerNeilBrown <neilb@suse.de>
Wed, 27 Mar 2013 07:09:01 +0000 (18:09 +1100)
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 <neilb@suse.de>
drivers/md/md.c

index 491afda21fd9faf30a8ae311a070a68a6931c773..30132280d07b20ddc1dd49445b1bf1ee4f808853 100644 (file)
@@ -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);