Skip to content

Commit

Permalink
Restore force switch of md array to readonly at reboot time.
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
NeilBrown committed Aug 5, 2008
1 parent 19052c0 commit 2b25000
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion drivers/md/md.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
/*
Expand Down

0 comments on commit 2b25000

Please sign in to comment.