From: NeilBrown <neilb@suse.de>
To: linux-raid@vger.kernel.org
Cc: NeilBrown <neilb@suse.de>
Subject: [md PATCH 6/7] md: remove ability to explicit set an inactive array to 'clean'.
Date: Mon, 04 May 2009 16:58:50 +1000 [thread overview]
Message-ID: <20090504065850.11688.1442.stgit@notabene.brown> (raw)
In-Reply-To: <20090504065540.11688.39505.stgit@notabene.brown>
Being able to write 'clean' to an 'array_state' of an inactive array
to activate it in 'clean' mode is both unnecessary and inconvenient.
It is unnecessary because the same can be achieved by writing
'active'. This activates and array, but it still remains 'clean'
until the first write.
It is inconvenient because writing 'clean' is more often used to
cause an 'active' array to revert to 'clean' mode (thus blocking
any writes until a 'write-pending' is promoted to 'active').
Allowing 'clean' to both activate an array and mark an active array as
clean can lead to races: One program writes 'clean' to mark the
active array as clean at the same time as another program writes
'inactive' to deactivate (stop) and active array. Depending on which
writes first, the array could be deactivated and immediately
reactivated which isn't what was desired.
So just disable the use of 'clean' to activate an array.
Signed-off-by: NeilBrown <neilb@suse.de>
---
drivers/md/md.c | 7 ++-----
1 files changed, 2 insertions(+), 5 deletions(-)
diff --git a/drivers/md/md.c b/drivers/md/md.c
index 8350bde..1dd723d 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -3066,11 +3066,8 @@ array_state_store(mddev_t *mddev, const char *buf, size_t len)
} else
err = -EBUSY;
spin_unlock_irq(&mddev->write_lock);
- } else {
- mddev->ro = 0;
- mddev->recovery_cp = MaxSector;
- err = do_md_run(mddev);
- }
+ } else
+ err = -EINVAL;
break;
case active:
if (mddev->pers) {
next prev parent reply other threads:[~2009-05-04 6:58 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-05-04 6:58 [md PATCH 0/7] more md patches heading for 2.6.20 NeilBrown
2009-05-04 6:58 ` [md PATCH 1/7] md: fix loading of out-of-date bitmap NeilBrown
2009-05-04 6:58 ` [md PATCH 2/7] md/raid10: don't clear bitmap during recovery if array will still be degraded NeilBrown
2009-05-04 6:58 ` NeilBrown [this message]
2009-05-04 16:27 ` [md PATCH 6/7] md: remove ability to explicit set an inactive array to 'clean' Dan Williams
2009-05-05 17:04 ` Dan Williams
2009-05-07 2:52 ` Neil Brown
2009-05-04 6:58 ` [md PATCH 5/7] md: constify VFTs NeilBrown
2009-05-04 6:58 ` [md PATCH 3/7] md: fix some (more) errors with bitmaps on devices larger than 2TB NeilBrown
2009-05-04 6:58 ` [md PATCH 4/7] md: tidy up status_resync to handle large arrays NeilBrown
2009-05-04 6:58 ` [md PATCH 7/7] md: remove rd%d links immediately after stopping an array NeilBrown
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20090504065850.11688.1442.stgit@notabene.brown \
--to=neilb@suse.de \
--cc=linux-raid@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).