Skip to content

Commit

Permalink
md: don't update metadata when stopping a read-only array.
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
NeilBrown committed Apr 24, 2013
1 parent 7ceb17e commit b6d428c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/md/md.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit b6d428c

Please sign in to comment.