From b23d203ddf2d12f1318fe5f43a87f440f202c231 Mon Sep 17 00:00:00 2001 From: chungfengz Date: Thu, 6 Nov 2025 09:46:51 +0000 Subject: [PATCH] bluestore/BlueFS: fix bytes_written_slow counter with aio_write 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 (cherry picked from commit 5aa5b03932c4345343e5263431914c2484bd2b14) --- src/os/bluestore/BlueFS.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/os/bluestore/BlueFS.cc b/src/os/bluestore/BlueFS.cc index b27e22abd33..f104df4d593 100644 --- a/src/os/bluestore/BlueFS.cc +++ b/src/os/bluestore/BlueFS.cc @@ -4002,7 +4002,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; -- 2.47.3