kernfs: Add noop_fsync to supported kernfs_file_fops
authorTony Luck <tony.luck@intel.com>
Fri, 14 Oct 2016 17:56:42 +0000 (10:56 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 27 Oct 2016 15:47:11 +0000 (17:47 +0200)
If you edit a kernfs backed file with vi(1), you see an ugly error
message when you write the file because vi tries to fsync(2) the
file after writing, which fails.

We have noop_fsync() for this, use it.

Signed-off-by: Tony Luck <tony.luck@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/kernfs/file.c

index 2bcb86e6e6ca0988cbe4337c970247869db34a24..78219d5644e90aacaf3aeb9fdfe2a234f4e31b84 100644 (file)
@@ -911,6 +911,7 @@ const struct file_operations kernfs_file_fops = {
        .open           = kernfs_fop_open,
        .release        = kernfs_fop_release,
        .poll           = kernfs_fop_poll,
+       .fsync          = noop_fsync,
 };
 
 /**