patch-2.0.37 linux/fs/open.c

Next file: linux/fs/proc/array.c
Previous file: linux/fs/nls_iso8859_15.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.0.36/linux/fs/open.c linux/fs/open.c
@@ -68,6 +68,10 @@
 	int error;
 	struct iattr newattrs;
 
+        /* Not pretty: "inode->i_size" shouldn't really be "off_t". But it is. */
+        if ((off_t) length < 0)
+        	return -EINVAL;
+                                 
 	down(&inode->i_sem);
 	newattrs.ia_size = length;
 	newattrs.ia_valid = ATTR_SIZE | ATTR_CTIME;

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov