1. 08 Feb, 2008 2 commits
    • James Lentini's avatar
      SUNRPC xptrdma: simplify build configuration · 3211e4eb
      James Lentini authored
      
      Trond and Bruce,
      
      This is a patch for 2.6.25. This is the same version that was sent out
      on December 12 for review (no comments to date).
      
      To simplify the RPC/RDMA client and server build configuration, make
      SUNRPC_XPRT_RDMA a hidden config option that continues to depend on
      SUNRPC and INFINIBAND. The value of SUNRPC_XPRT_RDMA will be:
      
       - N if either SUNRPC or INFINIBAND are N
       - M if both SUNRPC and INFINIBAND are on (M or Y) and at least one is M
       - Y if both SUNRPC and INFINIBAND are Y
      
      In 2.6.25, all of the RPC/RDMA related files are grouped in
      net/sunrpc/xprtrdma and the net/sunrpc/xprtrdma/Makefile builds both
      the client and server RPC/RDMA support using this config option.
      Signed-off-by: default avatarJames Lentini <jlentini@netapp.com>
      Signed-off-by: default avatarTrond Myklebust <Trond.Myklebust@netapp.com>
      3211e4eb
    • Trond Myklebust's avatar
      NFS: Fix a potential file corruption issue when writing · 5d47a356
      Trond Myklebust authored
      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()).
      Signed-off-by: default avatarTrond Myklebust <Trond.Myklebust@netapp.com>
      5d47a356
  2. 07 Feb, 2008 38 commits