Re: [RFC PATCH v3 07/11] iomap: Add DSYNC support to RWF_WRITETHROUGH

From: Pankaj Raghav (Samsung)

Date: Mon Aug 17 2026 - 09:26:36 EST


> 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?

> + wt_ctx->use_fua = false;
> + }
> +

--
Pankaj