From: Lumir Sliva <61183145+lumir-sliva@users.noreply.github.com> Date: Thu, 23 Apr 2026 11:18:18 +0000 (+0200) Subject: rgw: account presigned POST bytes_received in usage log X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=7d2484c45b4b7ec0129e701717e83ef20a52b753;p=ceph.git rgw: account presigned POST bytes_received in usage log Presigned POST uploads reported bytes_received=0 in the usage log, while equivalent PUT uploads reported the full object size. The AccountingFilter starts disabled, and only the PUT path explicitly enables it around its body read. POST bodies are consumed via RGWPostObj_ObjStore::read_with_boundary, which did not toggle accounting around its recv_body calls, so every byte pulled off the wire during multipart parsing was silently dropped by the accounter. Wrap the two recv_body calls in read_with_boundary with ACCOUNTING_IO(s)->set_account(true/false), mirroring the PUT pattern in RGWPutObj_ObjStore::get_data. POST uploads now account correctly; PUT behavior is unchanged. Signed-off-by: Lumir Sliva <61183145+lumir-sliva@users.noreply.github.com> Tracker: https://tracker.ceph.com/issues/76157 Reported-by: Maxim Monin --- diff --git a/src/rgw/rgw_rest.cc b/src/rgw/rgw_rest.cc index c592b7d2411d..9112cfe020da 100644 --- a/src/rgw/rgw_rest.cc +++ b/src/rgw/rgw_rest.cc @@ -1233,7 +1233,9 @@ int RGWPostObj_ObjStore::read_with_boundary(ceph::bufferlist& bl, bufferptr bp(need_to_read); + ACCOUNTING_IO(s)->set_account(true); const auto read_len = recv_body(s, bp.c_str(), need_to_read); + ACCOUNTING_IO(s)->set_account(false); if (read_len < 0) { return read_len; } @@ -1265,7 +1267,9 @@ int RGWPostObj_ObjStore::read_with_boundary(ceph::bufferlist& bl, if (left < skip + 2) { int need = skip + 2 - left; bufferptr boundary_bp(need); + ACCOUNTING_IO(s)->set_account(true); const int r = recv_body(s, boundary_bp.c_str(), need); + ACCOUNTING_IO(s)->set_account(false); if (r < 0) { return r; }