Re: [RFC PATCH v3 07/11] iomap: Add DSYNC support to RWF_WRITETHROUGH
From: Ojaswin Mujoo
Date: Fri Aug 28 2026 - 02:28:58 EST
On Mon, Aug 17, 2026 at 03:26:18PM +0200, Pankaj Raghav (Samsung) wrote:
> > return -EINVAL;
> >
> > + /*
> > + * If we realise that cache flush is necessary (eg FUA is not present
> > + * or we need metadata updates) then we turn off the optimization.
> > + */
> > + if (wt_ctx->use_fua) {
> > + if (iter->iomap.type != IOMAP_MAPPED ||
> > + (iter->iomap.flags &
> > + (IOMAP_F_NEW | IOMAP_F_SHARED | IOMAP_F_DIRTY)) ||
>
> > + (bdev_write_cache(iter->iomap.bdev) &&
> > + !bdev_fua(iter->iomap.bdev)))
> Shouldn't this be similar to DIO code: !bdev_write_cache() || bdev_fua()
> ?
>
> As long as bdev_fua() is supported, it does not matter if the
> bdev_write_cache is there or not right?
Hey Pankaj, sorry i somehow thought i replied to this already :/
So yeah we do keep the logic same as dio. In dio we enable FUA if:
(!bdev_write_cache(iomap->bdev) || bdev_fua(iomap->bdev)))
and here we __disable__ if
(bdev_write_cache(iter->iomap.bdev) && !bdev_fua(iter->iomap.bdev)))
So its the exact inverse of the dio check.
Regards,
ojaswin
>
> > + wt_ctx->use_fua = false;
> > + }
> > +
>
> --
> Pankaj