[PATCH 2.4] fix for large direct I/O

From: Eric Sandeen
Date: Wed Apr 14 2004 - 15:53:54 EST


This is a follow on to Ted Tso's patch which fixed up IOs of > 2G.
There seems to still be a problem with direct IO.

(Ted's patch was:
# ChangeSet 1.1058.2.2 -> 1.1058.2.3
# mm/filemap.c 1.85 -> 1.86
# fs/ext3/file.c 1.3 -> 1.4)


generic_file_direct_IO() takes a size_t count for the IO size, but then
assigns it to an int before checking for > chunk_size. Also, progress
is rolled up in an (int) progress var. These get garbled on ia64 for
example.

I think this patch takes care of these issues.

--- linux/mm/filemap.c_1.3 2004-04-14 15:46:43.000000000 -0500
+++ linux/mm/filemap.c 2004-04-14 15:46:32.000000000 -0500
@@ -1639,8 +1639,9 @@

static ssize_t generic_file_direct_IO(int rw, struct file * filp, char * buf, size_t count, loff_t offset)
{
- ssize_t retval;
- int new_iobuf, chunk_size, blocksize_mask, blocksize, blocksize_bits, iosize, progress;
+ ssize_t retval, progress;
+ int new_iobuf, chunk_size, blocksize_mask, blocksize, blocksize_bits;
+ size_t iosize;
struct kiobuf * iobuf;
struct address_space * mapping = filp->f_dentry->d_inode->i_mapping;
struct inode * inode = mapping->host;


--
Eric Sandeen [C]XFS for Linux http://oss.sgi.com/projects/xfs
sandeen@xxxxxxx SGI, Inc. 651-683-3102

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/