From 42a44b51d9807671731f74b12164639232bf754c Mon Sep 17 00:00:00 2001 From: overtrue Date: Fri, 14 Aug 2026 08:36:24 +0800 Subject: [PATCH] chore(rio): drop a dead store in the poison guard and note the end-block branch MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Review follow-up: the poison gate re-assigned an already-true flag, and the COMPRESS_TYPE_END branch reads as dead without stating that the writer never emits an end block — that absence is exactly what lets concatenated per-part streams decode as one. --- crates/rio/src/compress_reader.rs | 4 +++- rustfs/src/app/storage_api.rs | 3 +-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/crates/rio/src/compress_reader.rs b/crates/rio/src/compress_reader.rs index 037bb38f1..fb6ffeeba 100644 --- a/crates/rio/src/compress_reader.rs +++ b/crates/rio/src/compress_reader.rs @@ -248,7 +248,6 @@ where return Poll::Ready(Ok(())); } if *this.poisoned { - *this.poisoned = true; return Poll::Ready(Err(io::Error::new(io::ErrorKind::InvalidData, "decompress reader previously failed"))); } @@ -289,6 +288,9 @@ where (this.header_buf[1] as usize) | ((this.header_buf[2] as usize) << 8) | ((this.header_buf[3] as usize) << 16); *this.header_read = 0; + // `CompressReader` never emits an end block — a stream terminates on + // inner EOF, which is what lets concatenated per-part streams decode as + // one. This branch is kept for streams that do carry the marker. if typ == COMPRESS_TYPE_END { *this.compressed_read = 0; *this.compressed_len = 0; diff --git a/rustfs/src/app/storage_api.rs b/rustfs/src/app/storage_api.rs index 672008b86..32477b3fe 100644 --- a/rustfs/src/app/storage_api.rs +++ b/rustfs/src/app/storage_api.rs @@ -1153,8 +1153,7 @@ pub(crate) mod multipart_usecase { } pub(crate) use super::{ - access, bucket, compression, data_usage, error, helper, io, object_utils, options, request_context, s3_api, - set_disk, sse, + access, bucket, compression, data_usage, error, helper, io, object_utils, options, request_context, s3_api, set_disk, sse, }; pub(crate) use crate::storage::storage_api::{ECStore, StorageObjectInfo, StorageObjectOptions, StoragePutObjReader}; }