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

"Pankaj Raghav (Samsung)" <[email protected]>
Newsgroups org.kernel.vger.linux-fsdevel,org.kernel.vger.linux-kernel,org.kernel.vger.linux-xfs,org.kvack.linux-mm
Message-ID <aoMLboIzOmJzn7C0@quentin>
>  		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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.