Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 10 Aug 2007 16:49:16 +0900
From:      Daichi GOTO <daichi@freebsd.org>
To:        nowickis <nowickis@tlen.pl>
Cc:        freebsd-fs@freebsd.org
Subject:   Re: unionfs problem
Message-ID:  <46BC187C.6030209@freebsd.org>
In-Reply-To: <53617a56.fdaa6fb.469fde4f.a6f89@o2.pl>
References:  <53617a56.fdaa6fb.469fde4f.a6f89@o2.pl>

next in thread | previous in thread | raw e-mail | index | archive | help
This is a multi-part message in MIME format.
--------------090508060300040507090805
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit

nowickis wrote:
> Hi. 
> 
> I'm having problems using unionfs on freebsd. 
> Scenario is like this: On one machine (m1) I’m having /usr/ports dir with is updated every day. 
> On another machine (m2) I’m mounting /usr/ports from m1 by nfs to /usr/ports on m2. 
> Of course on m2 /usr/ports is read-only. So, I was starting to using unionfs on m2. 
> I have create dir (/tmp/somedir) and use unionfs as root mount_unionfs /tmp/somedir /usr/ports For now everything works fine, 
> I have writing privileges to /use/ports on m2. 
> I'm mono (http://www.go-mono.com) user, so I want to install the latest version of this port. 
> I need to use mono-merge script (which you can get from http://forge.novell.com/modules/xfmod/project/?bsd-sharp) to merge mono 
> ports tree witch /usr/ports tree. (this is the way do get the latest version of mono’s ports).
> When I run this script, after couple of seconds, my machine (m2) is freezing, completely no response. 
> Only what I can do is reset it. This freezing is occurring when mono-merge is recursion deleting some folders 
> in /usr/ports. Of course, then when /use/ports is on local machine (no mounted) mono-merge works fine. 
> This problem is occurring on freebsd 6.2 and 7.0. I have try traditional, transparent and masquerade mode. Result is the same. 
> Do you have any idea what I’m doing wrong? 
> Maybe there is a bug in unionfs. 
> 
> Regards 
> 
> Nowicki Sebastian 
> 

After long-long tests, at last, we had found the same problem you
reported.  Our research says that the issue depends on implementation
bug of nfs_readdir of nfsclient or nfs4client. (for detail, it ignores
eofflag request).

I include a patch that prevent that issue. Would you try please.

And we haveno plan to get it merged because this issue is not of
unionfs. It should be fixed on nfs_readdir of nfsclient. Thanks

-- 
   Daichi GOTO, http://people.freebsd.org/~daichi

--------------090508060300040507090805
Content-Type: text/x-patch;
 name="unionfs-nfs-hangup.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="unionfs-nfs-hangup.diff"

diff -urBN /usr/src.orig/sys/fs/unionfs/union_subr.c /usr/src/sys/fs/unionfs/union_subr.c
--- /usr/src.orig/sys/fs/unionfs/union_subr.c	2007-07-09 19:27:08.000000000 +0900
+++ /usr/src/sys/fs/unionfs/union_subr.c	2007-08-08 01:19:58.000000000 +0900
@@ -1129,7 +1129,7 @@
 		uio.uio_resid = iov.iov_len;
 
 		error = VOP_READDIR(lvp, &uio, cred, &eofflag, NULL, NULL);
-		if (error)
+		if (error || uio.uio_resid == sizeof(buf))
 			break;
 
 		edp = (struct dirent*)&buf[sizeof(buf) - uio.uio_resid];

--------------090508060300040507090805--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?46BC187C.6030209>