Skip to contentSkip to conversation

fix for large direct I/O

PATCH New Eric Sandeen 1 participant 1 message Apr 14, 2004

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fix for large direct I/O

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.

mm/filemap.c 2004-04-14 15:46:32.000000000 -0500 renamed from mm/filemap.c_1.3 2004-04-14 15:46:43.000000000 -0500 +3 -2
@@ -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;
Signature · 2 lines
Eric Sandeen      [C]XFS for Linux   http://oss.sgi.com/projects/xfs
[email protected]   SGI, Inc.          651-683-3102