aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--drivers/md/md.c3
1 files changed, 2 insertions, 1 deletions
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);