]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
reef: mds: use SimpleLock::WAIT_ALL for wait mask 67495/head
authorPatrick Donnelly <pdonnell@ibm.com>
Tue, 24 Feb 2026 19:30:24 +0000 (14:30 -0500)
committerPatrick Donnelly <pdonnell@ibm.com>
Wed, 25 Feb 2026 15:37:44 +0000 (10:37 -0500)
The Locker uses has_any_waiter for a particular lock to evaluate whether
to nudge the log. For the squid, tentacle, and main branches, this
larger bit mask (all 64 bits) will cause this to wrongly return true for
other locks which have waiters. The side-effect of waking requests
spuriously is undesirable but should not affect performance
significantly.

For reef and older releases, using std::numeric_limits<uint64_t>::max()
in has_any_waiter() causes a bitwise overflow that sets the wait-queue
search bound impossibly high, resulting in the method always incorrectly
returning false. This results in nudge_log never nudging the log!

Note: for reef the fix is different because of the interface refactor.
For that reason, this fix is applied directly to reef.

Fixes: db5c9dc2e6cc95a8d112c2131e4cac5340ca9dd0
Fixes: https://tracker.ceph.com/issues/75141
Signed-off-by: Patrick Donnelly <pdonnell@ibm.com>
src/mds/SimpleLock.h

index 2a852c29d29a1a0a37124fd9fd5db38ba2e49fa3..58c4bbb9919b20dc4671f3d36c0aa26bd9fe0f82 100644 (file)
@@ -223,7 +223,7 @@ public:
     return parent->is_waiter_for(mask << get_wait_shift());
   }
   bool has_any_waiter() const {
-    return is_waiter_for(std::numeric_limits<uint64_t>::max());
+    return parent->is_waiter_for(WAIT_ALL << get_wait_shift(), WAIT_RD << get_wait_shift());
   }
 
   bool is_cached() const {