From 0b8a3723b84ce0e34985f88a22fbd905d3c8ae2d Mon Sep 17 00:00:00 2001 From: Sebastien Buisson Date: Fri, 19 Jan 2024 18:09:14 +0100 Subject: [PATCH] DDN-4623 obdclass: fix upcall_cache_get_entry When an entry is found while holding the read lock, we need to convert to a write lock and find again, to check that entry was not modified/freed in between. In this case, the variable indicating an entry was found must be reset, because we might not find any valid entry after all. Fixes: 127128bed3 ("LU-16498 obdclass: change uc_lock to rwlock") Signed-off-by: Sebastien Buisson Change-Id: I111af4562ac78eeb22102a8a28943e46e30b4019 Reviewed-on: https://review.whamcloud.com/c/ex/lustre-release/+/53743 Reviewed-by: Andreas Dilger Tested-by: jenkins Tested-by: Maloo --- lustre/obdclass/upcall_cache.c | 1 + 1 file changed, 1 insertion(+) diff --git a/lustre/obdclass/upcall_cache.c b/lustre/obdclass/upcall_cache.c index 3058d3c..a9045ad 100644 --- a/lustre/obdclass/upcall_cache.c +++ b/lustre/obdclass/upcall_cache.c @@ -203,6 +203,7 @@ find_with_lock: * that entry was not modified/freed in between. */ write_lock_from_read(&cache->uc_lock, &writelock); + found = 0; goto find_with_lock; } list_move(&entry->ue_hash, head); -- 1.8.3.1