fbarray: check fbarray lock downgrade failure
PATCH 1/1 fbarray: check fbarray lock downgrade failure
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")
Signed-off-by Daniil Iskhakov <[email protected]>
---
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
--- lib/eal/common/eal_common_fbarray.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
lib/eal/common/eal_common_fbarray.c +3 -1
@@ -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;
Signature · 1 line
2.43.0