About this list Date view Thread view Subject view Author view Attachment view

From: Jan Zuchhold (Jan_at_Zuchhold.com)
Date: Wed 05 Nov 2003 - 10:02:56 GMT


> > There seems to be a problem with using nfs shares in a vserver with
> > vs1.00. It appears that it is related to file locking.
> >
> > The share is mounted like this in the vserver startup script:
> >
> > /usr/sbin/chbind --ip 192.168.1.145 --bcast 192.168.1.255 mount
> > -t nfs fileserver:/home /var/lib/vservers/$2/home
> >
> > After mounting the share it seems to work correctly (cd/ls/touch showing
> > no problems).
> >
> > When I start a process (in my case it's eclipse in jvm 1.4.1) which tries
> > to lock a file on that nfs share, it goes to state D ('uninterruptible
> > sleep') and cannot be killed. Any other process which tries to access the
> > share goes to state D as well.
>
> hmm, could you try to reproduce this without eclipse/jvm?
> (some small C programm or perl script will do)

I could track down the problem to the fcntl64 syscall.
Strace output:
10:36:19 fcntl64(3, F_SETLKW64, {type=F_WRLCK, whence=SEEK_SET, start=0,
len=0}

I attached a small perl script to reproduce this.

After that syscall the process goes to state D and if the lock would be
granted by the nfs server (if it is not locked already), there is no further
access possible to that nfs share, even umount -f does not work.
As far as I can tell, if the file is already locked by another process, it
just waits, as I would expect.

> > This problem does not appear in ctx-17c (the last version I tried
> > before), although the first three syslog messages appear as well.
>
> maybe the patch isn't the only variable in this game,
> maybe you patched another (newer?) kernel with v1.00?

(sorry I forgot to include the versions):
Both 2.4.22, same .config, just the vserver patch is different.
Host is debian stable/woody, vserver is debian unstable/sid.

Thank you,
Jan

--
#!/usr/bin/perl

use Fcntl;

open FH, ">locktest.lock" or die "Cannot open $fn: $!"; flock FH, 2; print "flock works...\n";

print "Testing fcntl...\n"; @list = (F_WRLCK,0,0,0,0); # exclusive write lock, entire file $struct = pack("SSLLL",@list); fcntl(FH,&F_SETLKW,$struct) or die("cannot lock because: $!\n");

# With vs1.00 I don't get here

print FH "blabla";

close FH;

_______________________________________________ Vserver mailing list Vserver_at_list.linux-vserver.org http://list.linux-vserver.org/mailman/listinfo/vserver


About this list Date view Thread view Subject view Author view Attachment view
[Next/Previous Months] [Main vserver Project Homepage] [Howto Subscribe/Unsubscribe] [Paul Sladen's vserver stuff]
Generated on Wed 05 Nov 2003 - 10:03:31 GMT by hypermail 2.1.3