[uml-devel] [PATCH] hostfs: Use noop_fsync for directories

2015-01-13 Thread Richard Weinberger
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: sta...@vger.kernel.org
Reported-and-tested-by: Daniel Gröber 
Signed-off-by: Richard Weinberger 
---
 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


--
New Year. New Location. New Benefits. New Data Center in Ashburn, VA.
GigeNET is offering a free month of service with a new server in Ashburn.
Choose from 2 high performing configs, both with 100TB of bandwidth.
Higher redundancy.Lower latency.Increased capacity.Completely compliant.
http://p.sf.net/sfu/gigenet
___
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel


Re: [uml-devel] [PATCH] hostfs: Use noop_fsync for directories

2015-01-13 Thread Christoph Hellwig
On Tue, Jan 13, 2015 at 11:15:58PM +0100, Richard Weinberger wrote:
> 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.

Shouldn't hostfs pass the fsync through to the host filesystem?

--
New Year. New Location. New Benefits. New Data Center in Ashburn, VA.
GigeNET is offering a free month of service with a new server in Ashburn.
Choose from 2 high performing configs, both with 100TB of bandwidth.
Higher redundancy.Lower latency.Increased capacity.Completely compliant.
http://p.sf.net/sfu/gigenet
___
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel


Re: [uml-devel] [PATCH] hostfs: Use noop_fsync for directories

2015-01-13 Thread Richard Weinberger
Am 13.01.2015 um 23:19 schrieb Christoph Hellwig:
> On Tue, Jan 13, 2015 at 11:15:58PM +0100, Richard Weinberger wrote:
>> 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.
> 
> Shouldn't hostfs pass the fsync through to the host filesystem?

hostfs tries do reduce the amount of syscall between guest and host as much
as possible. For file operations it passes everything down to the host but
for directory operations only ->iterate() does.

It is already horrible slow, if we add an ->open() for directory too it would
get even more slower. :-(

Thanks,
//richard

--
New Year. New Location. New Benefits. New Data Center in Ashburn, VA.
GigeNET is offering a free month of service with a new server in Ashburn.
Choose from 2 high performing configs, both with 100TB of bandwidth.
Higher redundancy.Lower latency.Increased capacity.Completely compliant.
http://p.sf.net/sfu/gigenet
___
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel