All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] hostfs: Use noop_fsync for directories
@ 2015-01-13 22:15 ` Richard Weinberger
  0 siblings, 0 replies; 9+ messages in thread
From: Richard Weinberger @ 2015-01-13 22:15 UTC (permalink / raw)
  To: user-mode-linux-devel
  Cc: dxld, linux-kernel, linux-fsdevel, Richard Weinberger, stable

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@vger.kernel.org
Reported-and-tested-by: Daniel Gröber <dxld@darkboxed.org>
Signed-off-by: Richard Weinberger <richard@nod.at>
---
 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-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2015-01-18  1:08 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-01-13 22:15 [PATCH] hostfs: Use noop_fsync for directories Richard Weinberger
2015-01-13 22:15 ` Richard Weinberger
2015-01-13 22:19 ` [uml-devel] " Christoph Hellwig
2015-01-13 22:19   ` Christoph Hellwig
2015-01-13 22:26   ` Richard Weinberger
2015-01-14  8:39     ` [uml-devel] " Christoph Hellwig
2015-01-14  8:39       ` Christoph Hellwig
2015-01-14  8:43       ` Richard Weinberger
2015-01-18  1:08         ` Daniel Gröber

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.