On Tue, Nov 17, 2026 at 07:41:22PM -0500, Benjamin Marzinski wrote:
> On Tue, Nov 17, 2026 at 09:19:17PM +0800, Yongpeng Yang wrote:
> > +void dm_bufio_set_retain_bytes(struct dm_bufio_client *c, unsigned long
> > bytes)
> > +{
> > + if (!bytes) {
> > + WRITE_ONCE(c->retain_bytes, READ_ONCE(dm_bufio_retain_bytes));
> > + return;
> > + }
> > +
> > + bytes -= bytes % c->block_size;
> > + if (!bytes)
> > + bytes = c->block_size;
>
> Instead of rounding down, except when that would round to 0, why not
> always round up, so dm_bufio retains at least as many bytes as
> requested?
Makes sense, I'll fix it in v2.
Thanks for the review,
Yongpeng