[OpenAFS-devel] locking on linux not working

Pavel Semerad semerad@ss1000.ms.mff.cuni.cz
Thu, 16 Jan 2003 15:41:09 +0100


Hi,
both 1.2.8a and CVS versions has error in locking on linux. F_SETLK(W) are converted to
F_GETLK due a mistake. Here is a fix:

--- ./src/afs/LINUX/osi_vnodeops.c.ps	2002-12-16 15:08:18.000000000 +0100
+++ ./src/afs/LINUX/osi_vnodeops.c	2003-01-16 15:26:06.000000000 +0100
@@ -542,11 +542,11 @@ static int afs_linux_lock(struct file *f
 
     /* Safe because there are no large files, yet */
 #if defined(F_GETLK64) && (F_GETLK != F_GETLK64)
-    if (cmd = F_GETLK64)
+    if (cmd == F_GETLK64)
 	cmd = F_GETLK;
-    else if (cmd = F_SETLK64)
+    else if (cmd == F_SETLK64)
 	cmd = F_SETLK;
-    else if (cmd = F_SETLKW64)
+    else if (cmd == F_SETLKW64)
 	cmd = F_SETLKW;
 #endif /* F_GETLK64 && F_GETLK != F_GETLK64 */
 

Pavel Semerad