On Wed, 11 Jun 2025, Damien Le Moal wrote: > On 6/11/25 12:28 PM, Christoph Hellwig wrote: > > On Wed, Jun 11, 2025 at 10:13:40AM +0900, Damien Le Moal wrote: > >> @@ -1322,6 +1323,7 @@ void dm_accept_partial_bio(struct bio *bio, unsigned int n_sectors) > >> BUG_ON(dm_tio_flagged(tio, DM_TIO_IS_DUPLICATE_BIO)); > >> BUG_ON(op_is_zone_mgmt(bio_op(bio))); > >> BUG_ON(bio_op(bio) == REQ_OP_ZONE_APPEND); > >> + BUG_ON(bio_flagged(bio, BIO_EMULATES_ZONE_APPEND)); > >> BUG_ON(bio_sectors > *tio->len_ptr); > >> BUG_ON(n_sectors > bio_sectors); > > > > Shouldn't all these be WARN_ON_ONCE and error return instead? > > Yes, I would prefer that, but that would be a more involved cleanup. > I can switch to doing that instead of this simple check. dm_accept_partial_bio doesn't return anything. I think that making it return an error and then checking for this "impossible" error in all the callers would just bloat the code. Mikulas