Restore force switch of md array to readonly at reboot time.

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: <git-commits-head@...>
Date: Friday, August 15, 2008 - 2:59 pm

Gitweb:     http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=2b2500...
Commit:     2b25000bf5157c28d8591f03f0575248a8cbd900
Parent:     19052c0e85a3e9d3b7d190b29fcdbf0e6c105381
Author:     NeilBrown <neilb@suse.de>
AuthorDate: Tue Aug 5 15:54:13 2008 +1000
Committer:  NeilBrown <neilb@suse.de>
CommitDate: Tue Aug 5 15:56:31 2008 +1000

    Restore force switch of md array to readonly at reboot time.
    
    A recent patch allowed do_md_stop to know whether it was being called
    via an ioctl or not, and thus where to allow for an extra open file
    descriptor when checking if it is in use.
    This broke then switch to readonly performed by the shutdown notifier,
    which needs to work even when the array is still (apparently) active
    (as md doesn't get told when the filesystem becomes readonly).
    
    So restore this feature by pretending that there can be lots of
    file descriptors open, but we still want do_md_stop to switch to
    readonly.
    
    Signed-off-by: NeilBrown <neilb@suse.de>
---
 drivers/md/md.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/drivers/md/md.c b/drivers/md/md.c
index 48afe4f..8d11cd1 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -6237,7 +6237,11 @@ static int md_notify_reboot(struct notifier_block *this,
 
 		for_each_mddev(mddev, tmp)
 			if (mddev_trylock(mddev)) {
-				do_md_stop (mddev, 1, 0);
+				/* Force a switch to readonly even array
+				 * appears to still be in use.  Hence
+				 * the '100'.
+				 */
+				do_md_stop (mddev, 1, 100);
 				mddev_unlock(mddev);
 			}
 		/*
--
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Restore force switch of md array to readonly at reboot time., Linux Kernel Mailing List..., (Fri Aug 15, 2:59 pm)