lkml.org 
[lkml]   [2003]   [Dec]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Date
    From
    Subject[PATCH] NFS O_DIRECT offset wrap bug
    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@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

    \
     
     \ /
      Last update: 2005-03-22 13:59    [W:2.499 / U:0.008 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site