1. 14 7月, 2012 1 次提交
  2. 30 5月, 2012 1 次提交
  3. 03 5月, 2012 1 次提交
  4. 02 4月, 2012 1 次提交
  5. 27 12月, 2011 1 次提交
    • L
      vfs: fix handling of lock allocation failure in lease-break case · 6d4b9e38
      Linus Torvalds 提交于
      Bruce Fields notes that commit 778fc546 ("locks: fix tracking of
      inprogress lease breaks") introduced a possible error pointer
      dereference on failure to allocate memory.  locks_conflict() will
      dereference the passed-in new lease lock structure that may be an error pointer.
      
      This means an open (without O_NONBLOCK set) on a file with a lease
      applied (generally only done when Samba or nfsd (with v4) is running)
      could crash if a kmalloc() fails.
      
      So instead of playing games with IS_ERROR() all over the place, just
      check the allocation failure early.  That makes the code more
      straightforward, and avoids this possible bad pointer dereference.
      Based-on-patch-by: NJ. Bruce Fields <bfields@redhat.com>
      Cc: Al Viro <viro@zeniv.linux.org.uk>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      6d4b9e38
  6. 28 9月, 2011 1 次提交
    • P
      doc: fix broken references · 395cf969
      Paul Bolle 提交于
      There are numerous broken references to Documentation files (in other
      Documentation files, in comments, etc.). These broken references are
      caused by typo's in the references, and by renames or removals of the
      Documentation files. Some broken references are simply odd.
      
      Fix these broken references, sometimes by dropping the irrelevant text
      they were part of.
      Signed-off-by: NPaul Bolle <pebolle@tiscali.nl>
      Signed-off-by: NJiri Kosina <jkosina@suse.cz>
      395cf969
  7. 21 9月, 2011 1 次提交
  8. 20 8月, 2011 4 次提交
    • J
      locks: setlease cleanup · c1f24ef4
      J. Bruce Fields 提交于
      There's an incorrect comment here.  Also clean up the logic: the
      "rdlease" and "wrlease" locals are confusingly named, and don't really
      add anything since we can make a decision as soon as we hit one of these
      cases.
      Signed-off-by: NJ. Bruce Fields <bfields@redhat.com>
      c1f24ef4
    • J
      locks: fix tracking of inprogress lease breaks · 778fc546
      J. Bruce Fields 提交于
      We currently use a bit in fl_flags to record whether a lease is being
      broken, and set fl_type to the type (RDLCK or UNLCK) that it will
      eventually have.  This means that once the lease break starts, we forget
      what the lease's type *used* to be.  Breaking a read lease will then
      result in blocking read opens, even though there's no conflict--because
      the lease type is now F_UNLCK and we can no longer tell whether it was
      previously a read or write lease.
      
      So, instead keep fl_type as the original type (the type which we
      enforce), and keep track of whether we're unlocking or merely
      downgrading by replacing the single FL_INPROGRESS flag by
      FL_UNLOCK_PENDING and FL_DOWNGRADE_PENDING flags.
      
      To get this right we also need to track separate downgrade and break
      times, to handle the case where a write-leased file gets conflicting
      opens first for read, then later for write.
      
      (I first considered just eliminating the downgrade behavior
      completely--nfsv4 doesn't need it, and nobody as far as I can tell
      actually uses it currently--but Jeremy Allison tells me that Windows
      oplocks do behave this way, so Samba will probably use this some day.)
      Reviewed-by: NJeff Layton <jlayton@redhat.com>
      Signed-off-by: NJ. Bruce Fields <bfields@redhat.com>
      778fc546
    • J
      locks: move F_INPROGRESS from fl_type to fl_flags field · 710b7216
      J. Bruce Fields 提交于
      F_INPROGRESS isn't exposed to userspace.  To me it makes more sense in
      fl_flags....
      Reviewed-by: NJeff Layton <jlayton@redhat.com>
      Signed-off-by: NJ. Bruce Fields <bfields@redhat.com>
      710b7216
    • J
      locks: minor lease cleanup · ab83fa4b
      J. Bruce Fields 提交于
      Use a helper function, to simplify upcoming changes.
      Reviewed-by: NJeff Layton <jlayton@redhat.com>
      Signed-off-by: NJ. Bruce Fields <bfields@redhat.com>
      ab83fa4b
  9. 21 7月, 2011 1 次提交
    • J
      locks: rename lock-manager ops · 8fb47a4f
      J. Bruce Fields 提交于
      Both the filesystem and the lock manager can associate operations with a
      lock.  Confusingly, one of them (fl_release_private) actually has the
      same name in both operation structures.
      
      It would save some confusion to give the lock-manager ops different
      names.
      Signed-off-by: NJ. Bruce Fields <bfields@redhat.com>
      8fb47a4f
  10. 16 7月, 2011 1 次提交
  11. 07 7月, 2011 1 次提交
    • M
      fs: fix lock initialization · a51cb91d
      Miklos Szeredi 提交于
      locks_alloc_lock() assumed that the allocated struct file_lock is
      already initialized to zero members.  This is only true for the first
      allocation of the structure, after reuse some of the members will have
      random values.
      
      This will for example result in passing random fl_start values to
      userspace in fuse for FL_FLOCK locks, which is an information leak at
      best.
      
      Fix by reinitializing those members which may be non-zero after freeing.
      Signed-off-by: NMiklos Szeredi <mszeredi@suse.cz>
      CC: stable@kernel.org
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      a51cb91d
  12. 08 3月, 2011 1 次提交
  13. 05 3月, 2011 1 次提交
  14. 07 1月, 2011 1 次提交
  15. 05 1月, 2011 2 次提交
  16. 18 11月, 2010 1 次提交
  17. 11 11月, 2010 2 次提交
  18. 31 10月, 2010 5 次提交
  19. 28 10月, 2010 3 次提交
  20. 27 10月, 2010 1 次提交
    • J
      procfs: fix numbering in /proc/locks · 99dc8292
      Jerome Marchand 提交于
      The lock number in /proc/locks (first field) is implemented by a counter
      (private field of struct seq_file) which is incremented at each call of
      locks_show() and reset to 1 in locks_start() whatever the offset is.  It
      should be reset according to the actual position in the list.  Because of
      this, the numbering erratically restarts at 1 several times when reading a
      long /proc/locks file.
      
      Moreover, locks_show() can be called twice to print a single line thus
      skipping a number.  The counter should be incremented in locks_next().
      
      And last, pos is a loff_t, which can be bigger than a pointer, so we don't
      use the pointer as an integer anymore, and allocate a loff_t instead.
      Signed-off-by: NJerome Marchand <jmarchan@redhat.com>
      Cc: Pavel Emelyanov <xemul@parallels.com>
      Cc: Matthew Wilcox <matthew@wil.cx>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      99dc8292
  21. 05 10月, 2010 1 次提交
    • A
      fs/locks.c: prepare for BKL removal · b89f4321
      Arnd Bergmann 提交于
      This prepares the removal of the big kernel lock from the
      file locking code. We still use the BKL as long as fs/lockd
      uses it and ceph might sleep, but we can flip the definition
      to a private spinlock as soon as that's done.
      All users outside of fs/lockd get converted to use
      lock_flocks() instead of lock_kernel() where appropriate.
      
      Based on an earlier patch to use a spinlock from Matthew
      Wilcox, who has attempted this a few times before, the
      earliest patch from over 10 years ago turned it into
      a semaphore, which ended up being slower than the BKL
      and was subsequently reverted.
      
      Someone should do some serious performance testing when
      this becomes a spinlock, since this has caused problems
      before. Using a spinlock should be at least as good
      as the BKL in theory, but who knows...
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Acked-by: NMatthew Wilcox <willy@linux.intel.com>
      Cc: Christoph Hellwig <hch@lst.de>
      Cc: Trond Myklebust <trond.myklebust@fys.uio.no>
      Cc: "J. Bruce Fields" <bfields@fieldses.org>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Miklos Szeredi <mszeredi@suse.cz>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: John Kacur <jkacur@redhat.com>
      Cc: Sage Weil <sage@newdream.net>
      Cc: linux-kernel@vger.kernel.org
      Cc: linux-fsdevel@vger.kernel.org
      b89f4321
  22. 04 3月, 2010 1 次提交
  23. 05 2月, 2010 1 次提交
  24. 22 9月, 2009 1 次提交
  25. 18 7月, 2009 1 次提交
  26. 17 7月, 2009 1 次提交
  27. 25 4月, 2009 1 次提交
    • F
      lockd: call locks_release_private to cleanup per-filesystem state · a9e61e25
      Felix Blyakher 提交于
      For every lock request lockd creates a new file_lock object
      in nlmsvc_setgrantargs() by copying the passed in file_lock with
      locks_copy_lock(). A filesystem can attach it's own lock_operations
      vector to the file_lock. It has to be cleaned up at the end of the
      file_lock's life. However, lockd doesn't do it today, yet it
      asserts in nlmclnt_release_lockargs() that the per-filesystem
      state is clean.
      This patch fixes it by exporting locks_release_private() and adding
      it to nlmsvc_freegrantargs(), to be symmetrical to creating a
      file_lock in nlmsvc_setgrantargs().
      Signed-off-by: NFelix Blyakher <felixb@sgi.com>
      Signed-off-by: NJ. Bruce Fields <bfields@citi.umich.edu>
      a9e61e25
  28. 14 1月, 2009 1 次提交
  29. 14 11月, 2008 1 次提交