From 325420838ca08e1088cbda12b36d40770c13f56d Mon Sep 17 00:00:00 2001 From: Venky Shankar Date: Tue, 3 Jun 2025 10:04:44 +0000 Subject: [PATCH] client: catch buggy reference count drop for MetaRequest With the prior commit that introduces a synthetic delay in write operation so as to write a test reproducer which would interleave asynchronous fsync and an operation that makes the MDS send a early reply to the client (therefore, having the client track the early replied response for an inode in Inode::unsafe_ops). Now, this is enough to trick the client into the code path that causes a buggy reference drop for the request (MetaRequest), but, hitting the _exact_ crash backtrace requires the request to be a in various [x]list's. This last bit is tricky to synthetically massage in the test. So, in order to catch the buggy reference drop, it would suffice to assert on the reference count dropping to less than zero (0). Signed-off-by: Venky Shankar --- src/client/Client.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/src/client/Client.cc b/src/client/Client.cc index 92b0daf3cac..107419b7d8b 100644 --- a/src/client/Client.cc +++ b/src/client/Client.cc @@ -2288,6 +2288,7 @@ void Client::unregister_request(MetaRequest *req) void Client::put_request(MetaRequest *request) { + ceph_assert(request->ref >= 1); if (request->_put()) { int op = -1; if (request->success) -- 2.39.5