On Thu, 8 Feb 2007, Derrick J Brashear wrote:

On Thu, 8 Feb 2007, Marcus Watts wrote:

Christopher Allen Wing <[EMAIL PROTECTED]> writes:
...
There does not seem to be a good way to find out (e.g., autoconf test) if
a particular linux kernel has the 'old' or 'new' semantics of
flock_lock_file*(). The argument types of the functions have not changed.
...

This sounds like it's a feature that is almost exactly
tied to linux kernel version.  Testing the Linux kernel

Except for people like RedHat, Fedora, SuSe, who cherrypick patches.

should suffice to determine if the new locking semantics
are true.

Nope.

indeed.


this is what I am testing now. I believe it should be safe everywhere, and keep the existing semantics:


--- openafs-1.4.2/src/afs/LINUX/osi_vnodeops.c.orig     2007-02-08 
14:22:27.000000000 -0500
+++ openafs-1.4.2/src/afs/LINUX/osi_vnodeops.c  2007-02-08 14:28:26.000000000 
-0500
@@ -475,10 +475,8 @@
     if ((code == 0 || flp->fl_type == F_UNLCK) &&
         (cmd == F_SETLK || cmd == F_SETLKW)) {
 #ifdef AFS_LINUX26_ENV
-       struct file_lock flp2;
-       flp2 = *flp;
-       flp2.fl_flags &=~ FL_SLEEP;
-       code = posix_lock_file(fp, &flp2);
+       flp->fl_flags &=~ FL_SLEEP;
+       code = posix_lock_file(fp, flp);
 #else
        code = posix_lock_file(fp, flp, 0);
#endif @@ -534,10 +532,8 @@

     if ((code == 0 || flp->fl_type == F_UNLCK) &&
         (cmd == F_SETLK || cmd == F_SETLKW)) {
-       struct file_lock flp2;
-       flp2 = *flp;
-       flp2.fl_flags &=~ FL_SLEEP;
-       code = flock_lock_file_wait(fp, &flp2);
+       flp->fl_flags &=~ FL_SLEEP;
+       code = flock_lock_file_wait(fp, flp);
        if (code && flp->fl_type != F_UNLCK) {
            struct AFS_FLOCK flock2;
            flock2 = flock;
_______________________________________________
OpenAFS-devel mailing list
[email protected]
https://lists.openafs.org/mailman/listinfo/openafs-devel

Reply via email to