diff options
author | Dan Williams <dan.j.williams@intel.com> | 2008-09-15 20:58:42 -0700 |
---|---|---|
committer | Dan Williams <dan.j.williams@intel.com> | 2008-09-15 20:58:42 -0700 |
commit | 1770662bcac724915520fd0784b6f806c8d96752 (patch) | |
tree | eadc61fbd375d5120cbe9eb1a5036967bdf0f716 /mdadm.c | |
parent | c94709e83f662c4780aa9c6917b03c774747eca5 (diff) | |
download | mdadm-1770662bcac724915520fd0784b6f806c8d96752.tar.gz mdadm-1770662bcac724915520fd0784b6f806c8d96752.tar.xz mdadm-1770662bcac724915520fd0784b6f806c8d96752.zip |
'mdadm --wait-clean' wait for array to be marked clean
For use in distro shutdown scripts with a RAID root file system.
Returns immediately if the array is 'readonly', or not an externally
managed array. It is up to the distro's scripts to make sure no new
writes hit the device after this returns 'true'.
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'mdadm.c')
-rw-r--r-- | mdadm.c | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -214,6 +214,7 @@ int main(int argc, char *argv[]) case 'o': case 'w': case 'W': + case Waitclean: case 'K': if (!mode) newmode = MISC; break; } if (mode && newmode == mode) { @@ -770,6 +771,7 @@ int main(int argc, char *argv[]) case O(MISC,'o'): case O(MISC,'w'): case O(MISC,'W'): + case O(MISC, Waitclean): if (devmode && devmode != opt && (devmode == 'E' || (opt == 'E' && devmode != 'Q'))) { fprintf(stderr, Name ": --examine/-E cannot be given with -%c\n", @@ -1280,6 +1282,8 @@ int main(int argc, char *argv[]) rv |= ExamineBitmap(dv->devname, brief, ss); continue; case 'W': rv |= Wait(dv->devname); continue; + case Waitclean: + rv |= WaitClean(dv->devname); continue; } mdfd = open_mddev(dv->devname, 1); if (mdfd>=0) { |