[PATCH] NFS O_DIRECT offset wrap bug
From: Chuck Lever
Date: Thu Dec 18 2003 - 16:36:36 EST
hi marcelo-
here's an obvious mistake i made in the NFS O_DIRECT implementation. a
missing type cast causes the offset of direct read and write requests to
wrap at 4GB. please include this in 2.4.24-pre2.
as far as i can tell, this is not a problem for 2.6 NFS O_DIRECT.
diff -X ../dont-diff -Naurp 00-stock/fs/nfs/direct.c 01-direct-offset/fs/nfs/direct.c
--- 00-stock/fs/nfs/direct.c 2003-08-25 07:44:43.000000000 -0400
+++ 01-direct-offset/fs/nfs/direct.c 2003-12-18 16:28:20.000000000 -0500
@@ -354,7 +354,7 @@ nfs_direct_IO(int rw, struct file *file,
size_t count = iobuf->length;
struct dentry *dentry = file->f_dentry;
struct inode *inode = dentry->d_inode;
- loff_t offset = blocknr << inode->i_blkbits;
+ loff_t offset = (loff_t) blocknr << inode->i_blkbits;
switch (rw) {
case READ:
- Chuck Lever
--
corporate: <cel at netapp dot com>
personal: <chucklever at bigfoot dot com>
-
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/