1. 20 4月, 2008 2 次提交
    • T
      NFS: Ensure that the read code cleans up properly when rpc_run_task() fails · fdd1e74c
      Trond Myklebust 提交于
      In the case of readpage() we need to ensure that the pages get unlocked,
      and that the error is flagged.
      
      In the case of O_DIRECT, we need to ensure that the pages are all released.
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      fdd1e74c
    • T
      NFS: Fix nfs_wb_page() to always exit with an error or a clean page · 73e3302f
      Trond Myklebust 提交于
      It is possible for nfs_wb_page() to sometimes exit with 0 return value, yet
      the page is left in a dirty state.
      For instance in the case where the server rebooted, and the COMMIT request
      failed, then all the previously "clean" pages which were cached by the
      server, but were not guaranteed to have been writted out to disk,
      have to be redirtied and resent to the server.
      The fix is to have nfs_wb_page_priority() check that the page is clean
      before it exits...
      
      This fixes a condition that triggers the BUG_ON(PagePrivate(page)) in
      nfs_create_request() when we're in the nfs_readpage() path.
      
      Also eliminate a redundant BUG_ON(!PageLocked(page)) while we're at it. It
      turns out that clear_page_dirty_for_io() has the exact same test.
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      73e3302f
  2. 20 3月, 2008 12 次提交
  3. 15 3月, 2008 2 次提交
  4. 08 3月, 2008 3 次提交
  5. 06 3月, 2008 1 次提交
    • E
      NFS: use new LSM interfaces to explicitly set mount options · f9c3a380
      Eric Paris 提交于
      NFS and SELinux worked together previously because SELinux had NFS
      specific knowledge built in.  This design was approved by both groups
      back in 2004 but the recent NFS changes to use nfs_parsed_mount_data and
      the usage of nfs_clone_mount_data showed this to be a poor fragile
      solution.  This patch fixes the NFS functionality regression by making
      use of the new LSM interfaces to allow an FS to explicitly set its own
      mount options.
      
      The explicit setting of mount options is done in the nfs get_sb
      functions which are called before the generic vfs hooks try to set mount
      options for filesystems which use text mount data.
      
      This does not currently support NFSv4 as that functionality did not
      exist in previous kernels and thus there is no regression.  I will be
      adding the needed code, which I believe to be the exact same as the v3
      code, in nfs4_get_sb for 2.6.26.
      Signed-off-by: NEric Paris <eparis@redhat.com>
      Acked-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      Signed-off-by: NJames Morris <jmorris@namei.org>
      f9c3a380
  6. 29 2月, 2008 2 次提交
  7. 26 2月, 2008 6 次提交
  8. 22 2月, 2008 1 次提交
  9. 21 2月, 2008 2 次提交
    • H
      nfs: fix sparse warnings · 90dc7d27
      Harvey Harrison 提交于
      fs/nfs/nfs4state.c:788:34: warning: Using plain integer as NULL pointer
      fs/nfs/delegation.c:52:34: warning: Using plain integer as NULL pointer
      fs/nfs/idmap.c:312:12: warning: Using plain integer as NULL pointer
      fs/nfs/callback_xdr.c:257:6: warning: Using plain integer as NULL pointer
      fs/nfs/callback_xdr.c:270:6: warning: Using plain integer as NULL pointer
      fs/nfs/callback_xdr.c:281:6: warning: Using plain integer as NULL pointer
      Signed-off-by: NHarvey Harrison <harvey.harrison@gmail.com>
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      90dc7d27
    • J
      NFS: flush signals before taking down callback thread · 1227a74e
      Jeff Layton 提交于
      Now that the reference counting on the callback thread is working as
      expected, it uncovers another problem.  Peter Staubach noticed while
      testing that patch on an older kernel that he would occasionally see
      this printk in rpc_register fire:
      
          "RPC: failed to contact portmap (errno -512).
      
      The NFSv4 callback thread is signaled by nfs_callback_down(), but never
      flushes that signal. All of the shutdown processing is done with that
      signal pending. This makes it fail the call to unregister the port with
      the portmapper.
      
      In actuality, this rpc_register call isn't necessary at all since the
      port isn't actually registered with the portmapper anymore. Regardless,
      there doesn't seem to be any reason to leave the signal pending while
      the thread is being shut down and flushing it should generally silence
      that printk.
      Signed-off-by: NJeff Layton <jlayton@redhat.com>
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      1227a74e
  10. 15 2月, 2008 2 次提交
  11. 14 2月, 2008 5 次提交
  12. 08 2月, 2008 2 次提交
    • T
      NFS: Fix a potential file corruption issue when writing · 5d47a356
      Trond Myklebust 提交于
      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: NTrond Myklebust <Trond.Myklebust@netapp.com>
      5d47a356
    • D
      Convert ERR_PTR(PTR_ERR(p)) instances to ERR_CAST(p) · e231c2ee
      David Howells 提交于
      Convert instances of ERR_PTR(PTR_ERR(p)) to ERR_CAST(p) using:
      
      perl -spi -e 's/ERR_PTR[(]PTR_ERR[(](.*)[)][)]/ERR_CAST(\1)/' `grep -rl 'ERR_PTR[(]*PTR_ERR' fs crypto net security`
      Signed-off-by: NDavid Howells <dhowells@redhat.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      e231c2ee