patch-1.3.53 linux/fs/read_write.c

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

diff -u --recursive --new-file v1.3.52/linux/fs/read_write.c linux/fs/read_write.c
@@ -263,6 +263,7 @@
 
 asmlinkage int sys_writev(unsigned long fd, const struct iovec * vector, long count)
 {
+	int error;
 	struct file * file;
 	struct inode * inode;
 
@@ -270,5 +271,8 @@
 		return -EBADF;
 	if (!(file->f_mode & 2))
 		return -EBADF;
-	return do_readv_writev(VERIFY_READ, inode, file, vector, count);
+	down(&inode->i_sem);
+	error = do_readv_writev(VERIFY_READ, inode, file, vector, count);
+	up(&inode->i_sem);
+	return error;
 }

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