Re: [PATCH RFC v4 2/3] iomap: use BIO_COMPLETE_IN_TASK for dropbehind writeback

From: Christoph Hellwig

Date: Fri Mar 27 2026 - 02:04:06 EST


On Wed, Mar 25, 2026 at 08:21:28PM +0000, Matthew Wilcox wrote:
> > + if (ioend_flags & IOMAP_IOEND_DONTCACHE)
> > + bio_set_flag(bio, BIO_COMPLETE_IN_TASK);
> > wbc_init_bio(wpc->wbc, bio);
> > wpc->nr_folios = 0;
> > return iomap_init_ioend(wpc->inode, bio, pos, ioend_flags);
>
> Can't we delete IOMAP_IOEND_DONTCACHE, and just do:
>
> if (folio_test_dropbehind(folio))
> bio_set_flag(&ioend->io_bio, BIO_COMPLETE_IN_TASK);
>
> It'd need to move down a few lines in iomap_add_to_ioend() to after
> bio_add_folio() succeeds.

Yes, that sounds sensible.