]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
client: do not check file size when inode does not have Fc caps
authorVenky Shankar <vshankar@redhat.com>
Tue, 20 May 2025 12:19:41 +0000 (12:19 +0000)
committerVenky Shankar <vshankar@redhat.com>
Mon, 23 Jun 2025 03:43:01 +0000 (09:13 +0530)
Since the client is holding Fr caps, the read request can be
directly sent to the OSD. The offset/in->size comparison check
is causing the read request to return with no data since in->size
isn't yet updated when another client does an extending write.

Introduced-by: 942474c2f5b4c696364f3b7411ae7d96444edfa8
Fixes: http://tracker.ceph.com/issues/70726
Signed-off-by: Venky Shankar <vshankar@redhat.com>
(cherry picked from commit 2b74598afc52d1a6cb98ef6b524ec162360cf040)

src/client/Client.cc

index 72960c1f268e326562e597e3d045c10f45802c0a..0bf45b4e4974126cc130c3b2116d6ea268045391 100644 (file)
@@ -11119,10 +11119,9 @@ retry:
     // C_Read_Sync_NonBlocking::finish().
 
     // trim read based on file size?
-    if (std::cmp_greater_equal(offset, in->size) || (size == 0)) {
-      // read is requested at the EOF or the read len is zero, therefore just
-      // release managed pointers and complete the C_Read_Finisher immediately with 0 bytes
-
+    if (size == 0) {
+      // zero byte read requested -- therefore just release managed
+      // pointers and complete the C_Read_Finisher immediately with 0 bytes
       Context *iof = iofinish.release();
       crf.release();
       iof->complete(0);