[Linux-cluster] GFS bug with fcntl/flock ?

Robert Hurst rhurst at bidmc.harvard.edu
Sat Oct 14 13:35:52 UTC 2006


Perfect, thank you!!

[root at net1 ~]# cd /usr/local/etc/cachesys
[root at net1 cachesys]# ll
total 68
-rw-r-Sr--  1 root root  3072 Oct 10 09:22 cache.reg
-r-xr-xr-x  1 root root 35221 Oct 10 09:22 ccontrol
-r-xr-xr-x  1 root root 16609 Oct 10 09:22 csession
[root at net1 cachesys]# chmod -s cache.reg
[root at net1 cachesys]# ll
total 68
-rw-r--r--  1 root root  3072 Oct 10 09:22 cache.reg
-r-xr-xr-x  1 root root 35221 Oct 10 09:22 ccontrol
-r-xr-xr-x  1 root root 16609 Oct 10 09:22 csession
[root at net1 cachesys]# ccontrol all
    Configuration     Version ID        Port   Directory
    ----------------  ----------------  -----
--------------------------------
dn >TOBY              5.0.19.6202.3            /toby/sys


On Fri, 2006-10-13 at 14:15 -0500, Abhijith Das wrote:

> Hi Robert,
> 
> > I am running InterSystems Caché 5.0.19 for AMD64, and an strace output 
> > from their utility reveals a problem with fcntl/flock on the GFS 
> > filesystem (mount -t gfs /dev/VGSHARE/lvol0 /usr/local):
> >
> >     open("/usr/local/etc/cachesys/cache.reg", O_RDONLY|O_NONBLOCK) = 3
> >     fcntl(3, F_SETLKW, {type=F_RDLCK, whence=SEEK_SET, start=0,
> >     len=0}) = -1 ENOLCK (No locks available)
> >
> The only place GFS returns ENOLCK is when mandatory locking is turned 
> on. It looks like you have the flags for mandatory locking set on this 
> particular file. i.e. S_ISGID is set and S_IXGRP is not set. If you do 
> an 'ls -al' on this file, you should see something like
>     [adas at radium locking]$ ls -al templock
>     -rwxr-Sr-x  1 adas adas 6 Oct 13 13:50 templock
> The 'S' in the permissions for the group indicate mandatory locking. GFS 
> does not support mandatory locking and will refuse to
> apply fcntl() or flock() on such files.
> You can try doing the same fcntl() with start=0 and len=0 on some other 
> regular file on gfs and see if that works for you.
> 
> > When I put their files on an ordinary ext3 filesystem, all works fine:
> >
> >     open("/usr/local/etc/cachesys/cache.reg", O_RDONLY|O_NONBLOCK) = 3
> >     fcntl(3, F_SETLKW, {type=F_RDLCK, whence=SEEK_SET, start=0,
> >     len=0}) = 0
> >
> When you copied the files over, they might have lost these flags, or 
> your ext3 fs supports mandatory locking ('-o mand' mount option)
> 
> > The man page on fcntl states that when flock is setup with 
> > whence=SEEK_SET, start=0, and len=0, the lock will occur on the entire 
> > file... so locking zero bytes in this manner is acceptable.  Help?
> 
> This works correctly in my test environment.
> 
> Hope this helps.
> 
> Regards,
> --Abhi
> 
> --
> Linux-cluster mailing list
> Linux-cluster at redhat.com
> https://www.redhat.com/mailman/listinfo/linux-cluster
> 


Robert Hurst, Sr. Caché Administrator
Beth Israel Deaconess Medical Center
1135 Tremont Street, REN-7
Boston, Massachusetts   02120-2140
617-754-8754 ∙ Fax: 617-754-8730 ∙ Cell: 401-787-3154
Any technology distinguishable from magic is insufficiently advanced.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/linux-cluster/attachments/20061014/c467a207/attachment.htm>


More information about the Linux-cluster mailing list