lkml.org 
[lkml]   [2008]   [Feb]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [GIT] Please pull 2 NFS client fixes
    On Thu, 07 Feb 2008 20:07:21 -0500 Trond Myklebust <Trond.Myklebust@netapp.com> wrote:

    > commit 5d47a35600270e7115061cb1320ee60ae9bcb6b8
    > Author: Trond Myklebust <Trond.Myklebust@netapp.com>
    > Date: Thu Feb 7 17:24:07 2008 -0500
    >
    > NFS: Fix a potential file corruption issue when writing
    >
    > If the inode is flagged as having an invalid mapping, then we can't rely on
    > the PageUptodate() flag. Ensure that we don't use the "anti-fragmentation"
    > write optimisation in nfs_updatepage(), since that will cause NFS to write
    > out areas of the page that are no longer guaranteed to be up to date.
    >
    > A potential corruption could occur in the following scenario:
    >
    > client 1 client 2
    > =============== ===============
    > fd=open("f",O_CREAT|O_WRONLY,0644);
    > write(fd,"fubar\n",6); // cache last page
    > close(fd);
    > fd=open("f",O_WRONLY|O_APPEND);
    > write(fd,"foo\n",4);
    > close(fd);
    >
    > fd=open("f",O_WRONLY|O_APPEND);
    > write(fd,"bar\n",4);
    > close(fd);
    > -----
    > The bug may lead to the file "f" reading 'fubar\n\0\0\0\nbar\n' because
    > client 2 does not update the cached page after re-opening the file for
    > write. Instead it keeps it marked as PageUptodate() until someone calls
    > invaldate_inode_pages2() (typically by calling read()).

    Is this one worth feeding back into 2.6.24.x? (for various values of "4"?)


    \
     
     \ /
      Last update: 2008-02-08 03:51    [W:0.031 / U:66.924 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site