From: Venky Shankar Date: Tue, 3 Jun 2025 10:04:44 +0000 (+0000) Subject: client: catch buggy reference count drop for MetaRequest X-Git-Tag: testing/wip-vshankar-testing-20250910.085256-debug~9^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=325420838ca08e1088cbda12b36d40770c13f56d;p=ceph-ci.git 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 --- 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)