# This is a BitKeeper generated patch for the following project: # Project Name: Linux kernel tree # This patch format is intended for GNU patch command version 2.5 or higher. # This patch includes the following deltas: # ChangeSet 1.1067 -> 1.1068 # fs/xfs/linux/xfs_lrw.c 1.166 -> 1.167 # # The following is the BitKeeper ChangeSet Log # -------------------------------------------- # 03/08/07 cattelan@xxxxxxxxxxx 1.1068 # Call generic_* functions directly rather than using generic_file_write # -------------------------------------------- # diff -Nru a/fs/xfs/linux/xfs_lrw.c b/fs/xfs/linux/xfs_lrw.c --- a/fs/xfs/linux/xfs_lrw.c Wed Aug 27 22:49:47 2003 +++ b/fs/xfs/linux/xfs_lrw.c Wed Aug 27 22:49:47 2003 @@ -586,12 +586,29 @@ } } + + if ((ssize_t) size < 0) + return -EINVAL; + + if (!access_ok(VERIFY_READ, buf, size)) + return -EFAULT; + retry: if (direct) { + struct inode *inode = file->f_dentry->d_inode->i_mapping->host; xfs_inval_cached_pages(vp, &xip->i_iocore, *offset, 1, 1); + + down_read(&inode->i_alloc_sem); + ret = do_generic_direct_write(file, buf, size, offset); + up_read(&inode->i_alloc_sem); + if (unlikely(ret == -ENOTBLK)) + goto fallback; + } else { +fallback: + ret = do_generic_file_write(file, buf, size, offset); } - ret = generic_file_write_nolock(file, buf, size, offset); +/* ret = generic_file_write_nolock(file, buf, size, offset); */ if (unlikely(file->f_mode & FINVIS)) { /* generic_file_write updates the mtime/ctime but we need