patch-1.3.90 linux/fs/namei.c

Next file: linux/fs/nfs/nfsroot.c
Previous file: linux/fs/dquot.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v1.3.89/linux/fs/namei.c linux/fs/namei.c
@@ -385,14 +385,6 @@
 		iput(dir);
 		return error;
 	}
-	/* SunOS, Solaris 2.x and HPUX all deny open() on
-	 * an existing file with mandatory locks.
-	 */
-	error = locks_verify_locked(inode);
-	if (error) {
-		iput(inode);
-		return error;
-	}
 	error = follow_link(dir,inode,flag,mode,&inode);
 	if (error)
 		return error;
@@ -438,18 +430,14 @@
 			iput(inode);
 			return error;
 		}
-#if 0
 		/*
-		 * In my opinion the mandatory lock check should really be
-		 * here. Only O_TRUNC calls can modify the file contents -
-		 * but none of the commercial OS'es seem to do it this way.
+		 * Refuse to truncate files with mandatory locks held on them
 		 */
 		error = locks_verify_locked(inode);
 		if (error) {
 			iput(inode);
 			return error;
 		}
-#endif
 		if (inode->i_sb && inode->i_sb->dq_op)
 			inode->i_sb->dq_op->initialize(inode, -1);
 			

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov with Sam's (original) version
of this