<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:times new roman, new york, times, serif;font-size:12pt"><div>Hi,<br><br>Let me try to explain my issue with gfs/gfs2 filesystem. I have two node cluster and a shared gfs filesystem which is mounted on both the nodes at the same time. I can access the filesystem from both nodes. <br>1. From node A I put a lock on a file called testfile and tried to put the lock on testfile from node B. I get message, file is already locked, which is good since file is locked from ndoe A.<br>2. Now unmount the filesystem on node B while lock is still there on testfile from node A and mount it back. Now try to put lock on the testfile from node B which is locked from node A. Expected result would be not to succeed in puting lock from node B, but "NO" I am able to put the lock from node B.<br>3. Node B does not know that there is some lock on testfile form node A but now
 if you release the lock from node A and put it again and then try to put lock on testfile from node B it works as expected means you will not be able to put lock on testfile. It says file is already locked.<br><br>It does not make any difference if I use gfs or gfs2 test works same way I tried on Oracle enterprise linux 5.1 and 5.2, which is nothing but redhat. Also node A or node B test results are same.<br><br>I have lock file which is compiled one but the following program also works the same way.<br>===========================================================================<br>/*<br>** lockdemo.c -- shows off your system's file locking.  Rated R.<br>*/<br><br>#include <stdio.h><br>#include <stdlib.h><br>#include <errno.h><br>#include <fcntl.h><br>#include <unistd.h><br><br>int main(int argc, char
 *argv[])<br>{<br>                     /* l_type   l_whence  l_start  l_len  l_pid   */<br>    struct flock fl = { F_WRLCK, SEEK_SET, 0,       0,     0 };<br>    int fd;<br><br>    fl.l_pid = getpid();<br><br>    if (argc > 1)<br>        fl.l_type = F_RDLCK;<br><br>    if ((fd = open("lockdemo.c", O_RDWR)) == -1) {<br>        perror("open");<br>        exit(1);<br>    }<br><br>    printf("Press <RETURN> to try to get lock: ");<br>    getchar();<br>    printf("Trying to get lock...");<br><br>    if (fcntl(fd,
 F_SETLKW, &fl) == -1) {<br>        perror("fcntl");<br>        exit(1);<br>    }<br><br>    printf("got lock\n");<br>    printf("Press <RETURN> to release lock: ");<br>    getchar();<br><br>    fl.l_type = F_UNLCK;  /* set to unlock same region */<br><br>    if (fcntl(fd, F_SETLK, &fl) == -1) {<br>        perror("fcntl");<br>        exit(1);<br>    }<br><br>    printf("Unlocked.\n");<br><br>    close(fd);<br>}<br><br>=============================================================================<br><br>I will be happy to provide more details as requested.<br><br>TIA<br>vip<br></div></div><br>



      </body></html>