summaryrefslogtreecommitdiffstats
path: root/Monitor.c
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-01-31 05:50:16 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-01-31 05:50:16 +0000
commit19c986195eab02a3b1da7b532df623cf46d92418 (patch)
tree639e479365923111fbeb91a7d24dad570d50d0ff /Monitor.c
parentAdding upstream version 4.2+20231121. (diff)
downloadmdadm-upstream/4.2+20240118.tar.xz
mdadm-upstream/4.2+20240118.zip
Adding upstream version 4.2+20240118.upstream/4.2+20240118
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'Monitor.c')
-rw-r--r--Monitor.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/Monitor.c b/Monitor.c
index 9a1f251..824a69f 100644
--- a/Monitor.c
+++ b/Monitor.c
@@ -1309,12 +1309,12 @@ int Wait(char *dev)
* sync_action does.
*/
struct mdinfo mdi;
- char buf[21];
+ char buf[SYSFS_MAX_BUF_SIZE];
if (sysfs_init(&mdi, -1, devnm))
return 2;
if (sysfs_get_str(&mdi, NULL, "sync_action",
- buf, 20) > 0 &&
+ buf, sizeof(buf)) > 0 &&
strcmp(buf,"idle\n") != 0) {
e->percent = RESYNC_UNKNOWN;
if (strcmp(buf, "frozen\n") == 0) {
@@ -1393,7 +1393,7 @@ int WaitClean(char *dev, int verbose)
if (rv) {
int state_fd = sysfs_open(fd2devnm(fd), NULL, "array_state");
- char buf[20];
+ char buf[SYSFS_MAX_BUF_SIZE];
int delay = 5000;
/* minimize the safe_mode_delay and prepare to wait up to 5s