diff options
author | NeilBrown <neilb@suse.de> | 2008-08-05 15:54:13 +1000 |
---|---|---|
committer | NeilBrown <neilb@suse.de> | 2008-08-05 15:56:31 +1000 |
commit | 2b25000bf5157c28d8591f03f0575248a8cbd900 (patch) | |
tree | f01260723348738076becc9f62872d87819f3159 /drivers/md/md.c | |
parent | 19052c0e85a3e9d3b7d190b29fcdbf0e6c105381 (diff) | |
download | linux-2b25000bf5157c28d8591f03f0575248a8cbd900.tar.bz2 |
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>
Diffstat (limited to 'drivers/md/md.c')
-rw-r--r-- | 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 48afe4f7ad4c..8d11cd1a0d8b 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); } /* |