[PATCH] hostfs: Use noop_fsync for directories

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Daniel reported that dpkg(1) dies if the root filesystem is a hostfs
because it does not expect fsync(2) to fail with EINVAL on directories.
While fsync(2) is allowed to fail with EINVAL if the filesystem does not
support it we can do better and use noop_fsync() to not confuse userspace
further.

Cc: stable@xxxxxxxxxxxxxxx
Reported-and-tested-by: Daniel Gröber <dxld@xxxxxxxxxxxxx>
Signed-off-by: Richard Weinberger <richard@xxxxxx>
---
 fs/hostfs/hostfs_kern.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/fs/hostfs/hostfs_kern.c b/fs/hostfs/hostfs_kern.c
index fd62cae..a7ac856 100644
--- a/fs/hostfs/hostfs_kern.c
+++ b/fs/hostfs/hostfs_kern.c
@@ -393,6 +393,7 @@ static const struct file_operations hostfs_dir_fops = {
 	.llseek		= generic_file_llseek,
 	.iterate	= hostfs_readdir,
 	.read		= generic_read_dir,
+	.fsync		= noop_fsync,
 };
 
 static int hostfs_writepage(struct page *page, struct writeback_control *wbc)
-- 
1.8.4.5

--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux