patch-2.3.9 linux/fs/locks.c

Next file: linux/fs/minix/dir.c
Previous file: linux/fs/lockd/host.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.3.8/linux/fs/locks.c linux/fs/locks.c
@@ -563,11 +563,14 @@
 	/* Candidates for mandatory locking have the setgid bit set
 	 * but no group execute bit -  an otherwise meaningless combination.
 	 */
-	if (IS_MANDLOCK(inode) &&
-	    (inode->i_mode & (S_ISGID | S_IXGRP)) == S_ISGID)
-		return (locks_mandatory_area(read_write, inode, filp, offset,
-					     count));
-	return (0);
+	if (IS_MANDLOCK(inode) && (inode->i_mode & (S_ISGID | S_IXGRP)) == S_ISGID) {
+		int retval;
+		lock_kernel();
+		retval = locks_mandatory_area(read_write, inode, filp, offset, count);
+		unlock_kernel();
+		return retval;
+	}
+	return 0;
 }
 
 int locks_mandatory_locked(struct inode *inode)

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)