From f9a1ac4d59c2a7b0d0065eccd1d68fcc32541f5b Mon Sep 17 00:00:00 2001 From: HC Date: Wed, 14 May 2014 20:58:11 -0400 Subject: [PATCH] Honor zfs_nocacheflush for file vdevs For consistency with disk vdevs honor the zfs_nocacheflush tunable. This setting is available primarily for debugging and performance analysis. Signed-off-by: HC Signed-off-by: Brian Behlendorf Closes #2336 --- module/zfs/vdev_file.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/module/zfs/vdev_file.c b/module/zfs/vdev_file.c index 330580224..8059cdea4 100644 --- a/module/zfs/vdev_file.c +++ b/module/zfs/vdev_file.c @@ -176,6 +176,10 @@ vdev_file_io_start(zio_t *zio) switch (zio->io_cmd) { case DKIOCFLUSHWRITECACHE: + + if (zfs_nocacheflush) + break; + zio->io_error = VOP_FSYNC(vf->vf_vnode, FSYNC | FDSYNC, kcred, NULL); break;