1. 10 7月, 2008 2 次提交
    • T
      NFS: Optimise append writes with holes · efc91ed0
      Trond Myklebust 提交于
      If a file is being extended, and we're creating a hole, we might as well
      declare the entire page to be up to date.
      
      This patch significantly improves the write performance for sparse files
      in the case where lseek(SEEK_END) is used to append several non-contiguous
      writes at intervals of < PAGE_SIZE.
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      efc91ed0
    • T
      NFS: Add correct bounds checking to NFSv2 locks · 2116271a
      Trond Myklebust 提交于
      NFSv2 file locking currently fails the Connectathon tests, because the
      calls to the VFS locking code do not return an EINVAL error if the
      struct file_lock overflows the 32-bit boundaries.
      
      The problem is due to the fact that we occasionally call helpers from
      fs/locks.c in order to avoid RPC calls to the server when we know that a
      local process holds the lock. These helpers are, of course, always
      64-bit enabled, so EINVAL is not returned in cases when it would if
      the call had gone to the NLM code.
      
      For consistency, we therefore add support for a bounds-checking helper.
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      2116271a
  2. 17 5月, 2008 1 次提交
  3. 20 4月, 2008 1 次提交
  4. 09 4月, 2008 1 次提交
  5. 20 3月, 2008 1 次提交
  6. 30 1月, 2008 2 次提交
  7. 20 10月, 2007 1 次提交
  8. 17 10月, 2007 1 次提交
  9. 10 10月, 2007 5 次提交
  10. 01 9月, 2007 1 次提交
    • T
      NFS: Fix a write request leak in nfs_invalidate_page() · 1b3b4a1a
      Trond Myklebust 提交于
      Ryusuke Konishi says:
      
      The recent truncate_complete_page() clears the dirty flag from a page
      before calling a_ops->invalidatepage(),
      ^^^^^^
      static void
      truncate_complete_page(struct address_space *mapping, struct page *page)
      {
              ...
              cancel_dirty_page(page, PAGE_CACHE_SIZE);  <--- Inserted here at
      kernel 2.6.20
      
              if (PagePrivate(page))
                      do_invalidatepage(page, 0);   ---> will call
      a_ops->invalidatepage()
              ...
      }
      
      and this is disturbing nfs_wb_page_priority() from calling 
      nfs_writepage_locked() that is expected to handle the pending
      request (=nfs_page) associated with the page.
      
      int nfs_wb_page_priority(struct inode *inode, struct page *page, int how)
      {
              ...
              if (clear_page_dirty_for_io(page)) {
                      ret = nfs_writepage_locked(page, &wbc);
                      if (ret < 0)
                              goto out;
              }
              ...
      }
      
      Since truncate_complete_page() will get rid of the page after
      a_ops->invalidatepage() returns, the request (=nfs_page) associated
      with the page becomes a garbage in nfs_inode->nfs_page_tree.
      ------------------------
      
      Fix this by ensuring that nfs_wb_page_priority() recognises that it may
      also need to clear out non-dirty pages that have an nfs_page associated
      with them.
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      1b3b4a1a
  11. 19 7月, 2007 2 次提交
    • J
      locks: make posix_test_lock() interface more consistent · 6d34ac19
      J. Bruce Fields 提交于
      Since posix_test_lock(), like fcntl() and ->lock(), indicates absence or
      presence of a conflict lock by setting fl_type to, respectively, F_UNLCK
      or something other than F_UNLCK, the return value is no longer needed.
      Signed-off-by: N"J. Bruce Fields" <bfields@citi.umich.edu>
      6d34ac19
    • J
      nfs: disable leases over NFS · 370f6599
      J. Bruce Fields 提交于
      As Peter Staubach says elsewhere
      (http://marc.info/?l=linux-kernel&m=118113649526444&w=2):
      
      > The problem is that some file system such as NFSv2 and NFSv3 do
      > not have sufficient support to be able to support leases correctly.
      > In particular for these two file systems, there is no over the wire
      > protocol support.
      >
      > Currently, these two file systems fail the fcntl(F_SETLEASE) call
      > accidentally, due to a reference counting difference.  These file
      > systems should fail more consciously, with a proper error to
      > indicate that the call is invalid for them.
      
      Define an nfs setlease method that just returns -EINVAL.
      
      If someone can demonstrate a real need, perhaps we could reenable
      them in the presence of the "nolock" mount option.
      Signed-off-by: N"J. Bruce Fields" <bfields@citi.umich.edu>
      Cc: Peter Staubach <staubach@redhat.com>
      Cc: Trond Myklebust <Trond.Myklebust@netapp.com>
      370f6599
  12. 10 7月, 2007 1 次提交
  13. 22 5月, 2007 1 次提交
    • A
      Detach sched.h from mm.h · e8edc6e0
      Alexey Dobriyan 提交于
      First thing mm.h does is including sched.h solely for can_do_mlock() inline
      function which has "current" dereference inside. By dealing with can_do_mlock()
      mm.h can be detached from sched.h which is good. See below, why.
      
      This patch
      a) removes unconditional inclusion of sched.h from mm.h
      b) makes can_do_mlock() normal function in mm/mlock.c
      c) exports can_do_mlock() to not break compilation
      d) adds sched.h inclusions back to files that were getting it indirectly.
      e) adds less bloated headers to some files (asm/signal.h, jiffies.h) that were
         getting them indirectly
      
      Net result is:
      a) mm.h users would get less code to open, read, preprocess, parse, ... if
         they don't need sched.h
      b) sched.h stops being dependency for significant number of files:
         on x86_64 allmodconfig touching sched.h results in recompile of 4083 files,
         after patch it's only 3744 (-8.3%).
      
      Cross-compile tested on
      
      	all arm defconfigs, all mips defconfigs, all powerpc defconfigs,
      	alpha alpha-up
      	arm
      	i386 i386-up i386-defconfig i386-allnoconfig
      	ia64 ia64-up
      	m68k
      	mips
      	parisc parisc-up
      	powerpc powerpc-up
      	s390 s390-up
      	sparc sparc-up
      	sparc64 sparc64-up
      	um-x86_64
      	x86_64 x86_64-up x86_64-defconfig x86_64-allnoconfig
      
      as well as my two usual configs.
      Signed-off-by: NAlexey Dobriyan <adobriyan@gmail.com>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      e8edc6e0
  14. 07 5月, 2007 1 次提交
  15. 13 2月, 2007 1 次提交
  16. 31 1月, 2007 1 次提交
  17. 12 1月, 2007 1 次提交
    • T
      [PATCH] NFS: Fix race in nfs_release_page() · e3db7691
      Trond Myklebust 提交于
          NFS: Fix race in nfs_release_page()
      
          invalidate_inode_pages2() may find the dirty bit has been set on a page
          owing to the fact that the page may still be mapped after it was locked.
          Only after the call to unmap_mapping_range() are we sure that the page
          can no longer be dirtied.
          In order to fix this, NFS has hooked the releasepage() method and tries
          to write the page out between the call to unmap_mapping_range() and the
          call to remove_mapping(). This, however leads to deadlocks in the page
          reclaim code, where the page may be locked without holding a reference
          to the inode or dentry.
      
          Fix is to add a new address_space_operation, launder_page(), which will
          attempt to write out a dirty page without releasing the page lock.
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      
          Also, the bare SetPageDirty() can skew all sort of accounting leading to
          other nasties.
      
      [akpm@osdl.org: cleanup]
      Signed-off-by: NPeter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Trond Myklebust <Trond.Myklebust@netapp.com>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      e3db7691
  18. 09 12月, 2006 1 次提交
  19. 06 12月, 2006 5 次提交
  20. 01 10月, 2006 1 次提交
  21. 23 9月, 2006 2 次提交
  22. 25 8月, 2006 1 次提交
  23. 29 6月, 2006 1 次提交
  24. 23 6月, 2006 1 次提交
    • M
      [PATCH] vfs: add lock owner argument to flush operation · 75e1fcc0
      Miklos Szeredi 提交于
      Pass the POSIX lock owner ID to the flush operation.
      
      This is useful for filesystems which don't want to store any locking state
      in inode->i_flock but want to handle locking/unlocking POSIX locks
      internally.  FUSE is one such filesystem but I think it possible that some
      network filesystems would need this also.
      
      Also add a flag to indicate that a POSIX locking request was generated by
      close(), so filesystems using the above feature won't send an extra locking
      request in this case.
      Signed-off-by: NMiklos Szeredi <miklos@szeredi.hu>
      Cc: Trond Myklebust <trond.myklebust@fys.uio.no>
      Cc: Al Viro <viro@zeniv.linux.org.uk>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      75e1fcc0
  25. 09 6月, 2006 2 次提交
  26. 20 4月, 2006 1 次提交
  27. 29 3月, 2006 1 次提交