[PATCH] fbarray: check fbarray lock downgrade failure

Daniil Iskhakov dish at amicon.ru
Tue Jul 14 10:02:42 CEST 2026


Return value of eal_file_lock() is ignored in the fbarray destroy error
path.

Check the return value and log the downgrade failure while keeping the
original rte_errno reported by unlink().

Found by Linux Verification Center (linuxtesting.org) with SVACE.

Fixes: 176bb37ca6f3 ("eal: introduce internal wrappers for file operations")
Cc: stable at dpdk.org

Signed-off-by: Daniil Iskhakov <dish at amicon.ru>
---
Cc: dmitry.kozliuk at gmail.com
Cc: sdl.dpdk at linuxtesting.org
Cc: rrv at amicon.ru
---
 lib/eal/common/eal_common_fbarray.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/lib/eal/common/eal_common_fbarray.c b/lib/eal/common/eal_common_fbarray.c
index 8bdcefb717..5a694ccdae 100644
--- a/lib/eal/common/eal_common_fbarray.c
+++ b/lib/eal/common/eal_common_fbarray.c
@@ -1022,7 +1022,9 @@ rte_fbarray_destroy(struct rte_fbarray *arr)
 			 * we're still holding an exclusive lock, so drop it to
 			 * shared.
 			 */
-			eal_file_lock(fd, EAL_FLOCK_SHARED, EAL_FLOCK_RETURN);
+			if (eal_file_lock(fd, EAL_FLOCK_SHARED, EAL_FLOCK_RETURN))
+				EAL_LOG(DEBUG, "Cannot restore fbarray shared lock: %s",
+					rte_strerror(rte_errno));
 
 			ret = -1;
 			goto out;
-- 
2.43.0



More information about the dev mailing list