mdadm/0043-mdadm-use-standard-libc-nftw.patch
Xiao Ni aa7b8fe976 Update to latest upstream
Resolves: RHEL-100004, RHEL-107084

Signed-off-by: Xiao Ni <xni@redhat.com>
2025-10-28 17:17:30 +08:00

59 lines
1.7 KiB
Diff

From e549ac6ab2ce5e7ec182310f8f5f2e41c6ac9233 Mon Sep 17 00:00:00 2001
From: Xiao Ni <xni@redhat.com>
Date: Wed, 7 May 2025 18:06:59 +0800
Subject: [PATCH 43/74] mdadm: use standard libc nftw
commit bd648e3bec3d ("mdadm: Remove klibc and uclibc support") removes
macro HAVE_NFTW/HAVE_FTW and uses libc header ftw.h. But it leaves the
codes in lib.c which let mdadm command call nftw defined in lib.c. It
needs to remove these codes.
The bug can be reproduced by:
mdadm -CR /dev/md0 --level raid5 --metadata=1.1 --chunk=32 --raid-disks 3
--size 10000 /dev/loop1 /dev/loop2 /dev/loop3
mdadm /dev/md0 --grow --chunk=64
mdadm: /dev/md0: cannot open component -unknown-
Fixes: bd648e3bec3d ("mdadm: Remove klibc and uclibc support")
Signed-off-by: Xiao Ni <xni@redhat.com>
---
lib.c | 22 ----------------------
1 file changed, 22 deletions(-)
diff --git a/lib.c b/lib.c
index f36ae03a3fa0..eb6cc1194cab 100644
--- a/lib.c
+++ b/lib.c
@@ -245,28 +245,6 @@ int add_dev(const char *name, const struct stat *stb, int flag, struct FTW *s)
return 0;
}
-#ifndef HAVE_NFTW
-#ifdef HAVE_FTW
-int add_dev_1(const char *name, const struct stat *stb, int flag)
-{
- return add_dev(name, stb, flag, NULL);
-}
-int nftw(const char *path,
- int (*han)(const char *name, const struct stat *stb,
- int flag, struct FTW *s), int nopenfd, int flags)
-{
- return ftw(path, add_dev_1, nopenfd);
-}
-#else
-int nftw(const char *path,
- int (*han)(const char *name, const struct stat *stb,
- int flag, struct FTW *s), int nopenfd, int flags)
-{
- return 0;
-}
-#endif /* HAVE_FTW */
-#endif /* HAVE_NFTW */
-
/*
* Find a block device with the right major/minor number.
* If we find multiple names, choose the shortest.
--
2.50.1