Date: Thu, 09 Jun 2005 09:12:32 +0000 From: "Valerio Daelli" <vdaelli@hotmail.com> To: freebsd-questions@freebsd.org Subject: Jails on NFS: locks on file Message-ID: <BAY103-F8F0F36969A508021F16CCB0FC0@phx.gbl> In-Reply-To: <20050609082759.GA1851@gicco.homeip.net>
next in thread | previous in thread | raw e-mail | index | archive | help
Hi all, we are using FreeBSD 5.4 with some jails. One of this jail is on a NFS directory - I mean: the whole filesystem of this jail is on a remote directory, exported by a FreeBSD 5.4 server with NFS, and the 'host' system (the one that started and stopped the jail) mounts it via NFS. In this jail we can't perform a 'flock' operation, even if the NFS server has rpc.lockd and rpc.statd. We built a little executable in C like this (let's call it myflock): ___________________________________________________________ #include <stdio.h> #include <errno.h> #include <fcntl.h> int main() { int lockfd; char* tempfile="tempfile"; lockfd=open(tempfile,O_CREAT); if (flock(lockfd, LOCK_SH|LOCK_NB)==-1) { printf("ERROR shared lock: %d",errno); } if (flock(lockfd, LOCK_EX|LOCK_NB)==-1) { printf("ERROR exclusive lock: %d",errno); } close(lockfd); } ___________________________________________________________ We executed on a local directory and it gets the flock. We executed on the mounted NFS partition (with rpc.lockd and rpc.statd) and it works. We executed in the jail-NFS and it fails! Errno 45 (from '/usr/include/errno.h': #define EOPNOTSUPP 45 /* Operation not supported */). The directory where we launch myflock is the same as the previous command (no permission problems). We executed in a jail contained in a md mounted on a NFS directory and it works. Could it be a rpcbind issue (the jail can't get the flock since it can't rpc-contact the NFS server)? Thanks a lot Valerio Daelli
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?BAY103-F8F0F36969A508021F16CCB0FC0>