patch-2.0.36 linux/fs/read_write.c

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

diff -u --recursive --new-file v2.0.35/linux/fs/read_write.c linux/fs/read_write.c
@@ -155,7 +155,12 @@
 	if (!file->f_op || !file->f_op->write)
 		goto out;
 	error = 0;
-	if (!count)
+	/*
+	 *	If this was a development kernel we'd just drop the test
+	 *	its not so we do this for stricter compatibility both to
+	 *	applications and drivers.
+	 */
+	if (!count && !IS_ZERO_WR(inode))
 		goto out;
 	error = locks_verify_area(FLOCK_VERIFY_WRITE,inode,file,file->f_pos,count);
 	if (error)
@@ -268,6 +273,10 @@
 	fn = file->f_op->read;
 	if (type == VERIFY_READ)
 		fn = (IO_fn_t) file->f_op->write;		
+		
+	if(fn==NULL)
+		return -EOPNOTSUPP;
+		
 	vector = iov;
 	while (count > 0) {
 		void * base;

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