]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
client: Ensure file_cache cap is released.
authorChristopher Hoffman <choffman@redhat.com>
Fri, 8 Nov 2024 14:00:43 +0000 (14:00 +0000)
committerChristopher Hoffman <choffman@redhat.com>
Thu, 14 Aug 2025 20:08:09 +0000 (20:08 +0000)
Fixes: https://tracker.ceph.com/issues/68798
Fixes: https://tracker.ceph.com/issues/68831
Signed-off-by: Christopher Hoffman <choffman@redhat.com>
src/client/Client.cc

index 9f6fbcf51c7fee78c0bc5009b7a61151387cec57..375af11f6f3b21e49869ef196016e5e1a35cb9ac 100644 (file)
@@ -11681,6 +11681,8 @@ int Client::_read_async(Fh *f, uint64_t off, uint64_t len, bufferlist *bl,
 
     client_lock.lock();
     put_cap_ref(in, CEPH_CAP_FILE_CACHE);
+  } else {
+    put_cap_ref(in, CEPH_CAP_FILE_CACHE);
   }
 
   if (r >= 0) {
@@ -11695,8 +11697,6 @@ int Client::_read_async(Fh *f, uint64_t off, uint64_t len, bufferlist *bl,
     r = bl->length();
 
     update_read_io_size(bl->length());
-  } else {
-    put_cap_ref(in, CEPH_CAP_FILE_CACHE);
   }
 
   do_readahead(f, in, off, len);