[PATCH v2] nvmet: avoid unnecessary fsync and flush bio
Christoph Hellwig
hch at lst.de
Tue Jul 26 04:33:33 PDT 2022
On Mon, Jul 25, 2022 at 02:28:18PM +0800, Guixin Liu wrote:
> u16 nvmet_file_flush(struct nvmet_req *req)
> {
> - return errno_to_nvme_status(req, vfs_fsync(req->ns->file, 1));
> + if (req->ns->buffered_io)
> + return errno_to_nvme_status(req, vfs_fsync(req->ns->file, 1));
> + return NVME_SC_SUCCESS;
This is broken. Even direct I/O needs an fsync to commit metadata
changes.
More information about the Linux-nvme
mailing list