diff options
author | Dan Williams <dan.j.williams@intel.com> | 2008-09-28 12:12:06 -0700 |
---|---|---|
committer | Dan Williams <dan.j.williams@intel.com> | 2008-10-15 14:15:51 -0700 |
commit | 0dd3ba30aa1fbab2d7e62fca5169789ceb62b3f1 (patch) | |
tree | 9eafafde61587a4635c9cb8bbfa3d9d26c7c2a86 /sysfs.c | |
parent | 593add1b56877a6881419c2496eb26dd1f82d39b (diff) | |
download | mdadm-0dd3ba30aa1fbab2d7e62fca5169789ceb62b3f1.tar.gz mdadm-0dd3ba30aa1fbab2d7e62fca5169789ceb62b3f1.tar.xz mdadm-0dd3ba30aa1fbab2d7e62fca5169789ceb62b3f1.zip |
--wait-clean: shorten timeout
Set the safemode timeout to a small value to get the array marked clean as
soon as possible. We don't write 'clean' directly as it may cause mdmon to
miss a 'write-pending' event.
Include a couple fixes to sysfs_set_safemode():
1/ 0 pad the milliseconds field
2/ workaround input truncation in the kernel
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'sysfs.c')
-rw-r--r-- | sysfs.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -436,9 +436,10 @@ int sysfs_set_safemode(struct mdinfo *sra, unsigned long ms) char delay[30]; sec = ms / 1000; - msec = ms - (sec * 1000); + msec = ms % 1000; - sprintf(delay, "%ld.%ld", sec, msec); + sprintf(delay, "%ld.%03ld\n", sec, msec); + /* this '\n' ^ needed for kernels older than 2.6.28 */ return sysfs_set_str(sra, NULL, "safe_mode_delay", delay); } |