Re: [PATCH 1/7] chunk-format: introduce `pair_chunk_expect()` helper
- From
- Linus Arver <linusa@google.com>
- Date
- Jan 15, 2024, 22:53 UTC
- Message-ID
- <owly4jfei4xk.fsf@fine.c.googlers.com>
- In-Reply-To
- <owly8r4qi5zj.fsf@fine.c.googlers.com>
Linus Arver <linusa@google.com> writes:
Show 7 quoted lines
> So in summary there appear to be the following possibilities: > > CHUNK_MISSING > CHUNK_TOO_SMALL > CHUNK_OK > CHUNK_TOO_BIG_ALIGNED > CHUNK_TOO_BIG_MISALIGNED
On second thought, it appears that CHUNK_TOO_SMALL has three cases:
(1) chunk_size < record_size
(2) chunk_size >= record_size, but chunk_size < record_size * record_nr
and decreasing record_nr can make chunk_size "fit"
(3) chunk_size >= record_size, but chunk_size < record_size * record_nr
and decreasing record_nr cannot make chunk_size "fit"where (2) and (3) are just like the *_(MIS)ALIGNED cases above when chunk_size is too big.
My default position is that these additional cases might need to be treated differently, although maybe it's overkill also.
Thanks.