rgw: fix log_remove spurious -EIO on non-existent FIFO shards

the shared error code `ec` was not cleared before continuing
past a non-existent shard (ENOENT from get_meta). and if the last
shard returned ENOENT, `ec` retained that value and the
fired EIO even though all shards were cleanly removed.

also switch to sys::system_error(ec) to preserve the real errno

Signed-off-by: Shilpa Jagannath <smanjara@redhat.com>
This commit is contained in:
Shilpa Jagannath 2026-06-04 13:52:57 -04:00
parent 2314f7ae39
commit 78b6005865

View File

@ -180,7 +180,10 @@ asio::awaitable<void> log_remove(
= co_await fifo::FIFO::get_meta(rados, oid, loc, std::nullopt,
asio::redirect_error(asio::use_awaitable,
ec));
if (ec == sys::errc::no_such_file_or_directory) continue;
if (ec == sys::errc::no_such_file_or_directory) {
ec.clear();
continue;
}
if (!ec && info.head_part_num > -1) {
for (auto j = info.tail_part_num; j <= info.head_part_num; ++j) {
sys::error_code subec;
@ -219,8 +222,8 @@ asio::awaitable<void> log_remove(
<< ": " << ec.message() << dendl;
}
}
if (ec)
throw sys::error_code(ec);
if (ec && ec != sys::errc::no_such_file_or_directory)
throw sys::system_error(ec);
co_return;
}