]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
bluestore/BlueFS: fix bytes_written_slow counter with aio_write 66147/head
authorchungfengz <chungfengz@synology.com>
Thu, 6 Nov 2025 09:46:51 +0000 (09:46 +0000)
committerchungfengz <chungfengz@synology.com>
Thu, 6 Nov 2025 09:59:40 +0000 (09:59 +0000)
The bytes_written_slow performance counter was incorrectly reporting
0 when using async I/O.

When aio_write() is called with a bufferlist, it uses claim_append()
to transfer ownership of the buffer to the aio structure, leaving the
source bufferlist empty. Using t.length() after aio_write() returns 0
instead of the actual bytes written.

Fix by using the pre-calculated x_len value which contains the actual
write size and is not affected by the buffer ownership transfer.

Fixes: https://tracker.ceph.com/issues/73735
Signed-off-by: chungfengz <chungfengz@synology.com>
src/os/bluestore/BlueFS.cc

index 4db70c519e9c2319b9ceb8d1f9b704e2f1a18987..2f58f41dcb249a55b16ee973f78c9f9971747203 100644 (file)
@@ -4039,7 +4039,7 @@ int BlueFS::_flush_data(FileWriter *h, uint64_t offset, uint64_t length, bool bu
     }
     h->dirty_devs[p->bdev] = true;
     if (p->bdev == BDEV_SLOW) {
-      bytes_written_slow += t.length();
+      bytes_written_slow += x_len;
     }
 
     bloff += x_len;