1. 24 7月, 2015 1 次提交
  2. 16 4月, 2015 1 次提交
  3. 12 4月, 2015 3 次提交
  4. 26 3月, 2015 1 次提交
  5. 18 2月, 2015 1 次提交
  6. 09 8月, 2014 1 次提交
  7. 22 5月, 2014 1 次提交
    • J
      reiserfs: call truncate_setsize under tailpack mutex · 22e7478d
      Jeff Mahoney 提交于
      Prior to commit 0e4f6a79 (Fix reiserfs_file_release()), reiserfs
      truncates serialized on i_mutex. They mostly still do, with the exception
      of reiserfs_file_release. That blocks out other writers via the tailpack
      mutex and the inode openers counter adjusted in reiserfs_file_open.
      
      However, NFS will call reiserfs_setattr without having called ->open, so
      we end up with a race when nfs is calling ->setattr while another
      process is releasing the file. Ultimately, it triggers the
      BUG_ON(inode->i_size != new_file_size) check in maybe_indirect_to_direct.
      
      The solution is to pull the lock into reiserfs_setattr to encompass the
      truncate_setsize call as well.
      Signed-off-by: NJeff Mahoney <jeffm@suse.com>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: NJan Kara <jack@suse.cz>
      22e7478d
  8. 07 5月, 2014 10 次提交
  9. 04 4月, 2014 1 次提交
    • J
      mm + fs: store shadow entries in page cache · 91b0abe3
      Johannes Weiner 提交于
      Reclaim will be leaving shadow entries in the page cache radix tree upon
      evicting the real page.  As those pages are found from the LRU, an
      iput() can lead to the inode being freed concurrently.  At this point,
      reclaim must no longer install shadow pages because the inode freeing
      code needs to ensure the page tree is really empty.
      
      Add an address_space flag, AS_EXITING, that the inode freeing code sets
      under the tree lock before doing the final truncate.  Reclaim will check
      for this flag before installing shadow pages.
      Signed-off-by: NJohannes Weiner <hannes@cmpxchg.org>
      Reviewed-by: NRik van Riel <riel@redhat.com>
      Reviewed-by: NMinchan Kim <minchan@kernel.org>
      Cc: Andrea Arcangeli <aarcange@redhat.com>
      Cc: Bob Liu <bob.liu@oracle.com>
      Cc: Christoph Hellwig <hch@infradead.org>
      Cc: Dave Chinner <david@fromorbit.com>
      Cc: Greg Thelen <gthelen@google.com>
      Cc: Hugh Dickins <hughd@google.com>
      Cc: Jan Kara <jack@suse.cz>
      Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
      Cc: Luigi Semenzato <semenzato@google.com>
      Cc: Mel Gorman <mgorman@suse.de>
      Cc: Metin Doslu <metin@citusdata.com>
      Cc: Michel Lespinasse <walken@google.com>
      Cc: Ozgun Erdogan <ozgun@citusdata.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Roman Gushchin <klamm@yandex-team.ru>
      Cc: Ryan Mallon <rmallon@gmail.com>
      Cc: Tejun Heo <tj@kernel.org>
      Cc: Vlastimil Babka <vbabka@suse.cz>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      91b0abe3
  10. 09 8月, 2013 3 次提交
    • J
      reiserfs: locking, release lock around quota operations · d2d0395f
      Jeff Mahoney 提交于
      Previous commits released the write lock across quota operations but
      missed several places.  In particular, the free operations can also
      call into the file system code and take the write lock, causing
      deadlocks.
      
      This patch introduces some more helpers and uses them for quota call
      sites.  Without this patch applied, reiserfs + quotas runs into deadlocks
      under anything more than trivial load.
      Signed-off-by: NJeff Mahoney <jeffm@suse.com>
      d2d0395f
    • J
      reiserfs: locking, handle nested locks properly · 278f6679
      Jeff Mahoney 提交于
      The reiserfs write lock replaced the BKL and uses similar semantics.
      
      Frederic's locking code makes a distinction between when the lock is nested
      and when it's being acquired/released, but I don't think that's the right
      distinction to make.
      
      The right distinction is between the lock being released at end-of-use and
      the lock being released for a schedule. The unlock should return the depth
      and the lock should restore it, rather than the other way around as it is now.
      
      This patch implements that and adds a number of places where the lock
      should be dropped.
      Signed-off-by: NJeff Mahoney <jeffm@suse.com>
      278f6679
    • J
      reiserfs: locking, push write lock out of xattr code · 4c05141d
      Jeff Mahoney 提交于
      The reiserfs xattr code doesn't need the write lock and sleeps all over
      the place. We can simplify the locking by releasing it and reacquiring
      after the xattr call.
      Signed-off-by: NJeff Mahoney <jeffm@suse.com>
      4c05141d
  11. 01 6月, 2013 1 次提交
    • J
      reiserfs: fix deadlock with nfs racing on create/lookup · a1457c0c
      Jeff Mahoney 提交于
      Reiserfs is currently able to be deadlocked by having two NFS clients
      where one has removed and recreated a file and another is accessing the
      file with an open file handle.
      
      If one client deletes and recreates a file with timing such that the
      recreated file obtains the same [dirid, objectid] pair as the original
      file while another client accesses the file via file handle, the create
      and lookup can race and deadlock if the lookup manages to create the
      in-memory inode first.
      
      The create thread, in insert_inode_locked4, will hold the write lock
      while waiting on the other inode to be unlocked. The lookup thread,
      anywhere in the iget path, will release and reacquire the write lock while
      it schedules. If it needs to reacquire the lock while the create thread
      has it, it will never be able to make forward progress because it needs
      to reacquire the lock before ultimately unlocking the inode.
      
      This patch drops the write lock across the insert_inode_locked4 call so
      that the ordering of inode_wait -> write lock is retained. Since this
      would have been the case before the BKL push-down, this is safe.
      Signed-off-by: NJeff Mahoney <jeffm@suse.com>
      Signed-off-by: NJan Kara <jack@suse.cz>
      a1457c0c
  12. 22 5月, 2013 2 次提交
    • L
      reiserfs: use ->invalidatepage() length argument · bad54831
      Lukas Czerner 提交于
      ->invalidatepage() aop now accepts range to invalidate so we can make
      use of it in reiserfs_invalidatepage()
      Signed-off-by: NLukas Czerner <lczerner@redhat.com>
      Cc: reiserfs-devel@vger.kernel.org
      bad54831
    • L
      mm: change invalidatepage prototype to accept length · d47992f8
      Lukas Czerner 提交于
      Currently there is no way to truncate partial page where the end
      truncate point is not at the end of the page. This is because it was not
      needed and the functionality was enough for file system truncate
      operation to work properly. However more file systems now support punch
      hole feature and it can benefit from mm supporting truncating page just
      up to the certain point.
      
      Specifically, with this functionality truncate_inode_pages_range() can
      be changed so it supports truncating partial page at the end of the
      range (currently it will BUG_ON() if 'end' is not at the end of the
      page).
      
      This commit changes the invalidatepage() address space operation
      prototype to accept range to be invalidated and update all the instances
      for it.
      
      We also change the block_invalidatepage() in the same way and actually
      make a use of the new length argument implementing range invalidation.
      
      Actual file system implementations will follow except the file systems
      where the changes are really simple and should not change the behaviour
      in any way .Implementation for truncate_page_range() which will be able
      to accept page unaligned ranges will follow as well.
      Signed-off-by: NLukas Czerner <lczerner@redhat.com>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Hugh Dickins <hughd@google.com>
      d47992f8
  13. 08 5月, 2013 1 次提交
  14. 26 2月, 2013 1 次提交
  15. 21 12月, 2012 1 次提交
  16. 20 11月, 2012 1 次提交
  17. 10 10月, 2012 1 次提交
    • H
      tmpfs,ceph,gfs2,isofs,reiserfs,xfs: fix fh_len checking · 35c2a7f4
      Hugh Dickins 提交于
      Fuzzing with trinity oopsed on the 1st instruction of shmem_fh_to_dentry(),
      	u64 inum = fid->raw[2];
      which is unhelpfully reported as at the end of shmem_alloc_inode():
      
      BUG: unable to handle kernel paging request at ffff880061cd3000
      IP: [<ffffffff812190d0>] shmem_alloc_inode+0x40/0x40
      Oops: 0000 [#1] PREEMPT SMP DEBUG_PAGEALLOC
      Call Trace:
       [<ffffffff81488649>] ? exportfs_decode_fh+0x79/0x2d0
       [<ffffffff812d77c3>] do_handle_open+0x163/0x2c0
       [<ffffffff812d792c>] sys_open_by_handle_at+0xc/0x10
       [<ffffffff83a5f3f8>] tracesys+0xe1/0xe6
      
      Right, tmpfs is being stupid to access fid->raw[2] before validating that
      fh_len includes it: the buffer kmalloc'ed by do_sys_name_to_handle() may
      fall at the end of a page, and the next page not be present.
      
      But some other filesystems (ceph, gfs2, isofs, reiserfs, xfs) are being
      careless about fh_len too, in fh_to_dentry() and/or fh_to_parent(), and
      could oops in the same way: add the missing fh_len checks to those.
      Reported-by: NSasha Levin <levinsasha928@gmail.com>
      Signed-off-by: NHugh Dickins <hughd@google.com>
      Cc: Al Viro <viro@zeniv.linux.org.uk>
      Cc: Sage Weil <sage@inktank.com>
      Cc: Steven Whitehouse <swhiteho@redhat.com>
      Cc: Christoph Hellwig <hch@infradead.org>
      Cc: stable@vger.kernel.org
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      35c2a7f4
  18. 21 9月, 2012 1 次提交
  19. 15 8月, 2012 1 次提交
    • J
      reiserfs: fix deadlocks with quotas · 48d17884
      Jeff Mahoney 提交于
      The BKL push-down for reiserfs made lock recursion a special case that needs
      to be handled explicitly. One of the cases that was unhandled is dropping
      the quota during inode eviction. Both reiserfs_evict_inode and
      reiserfs_write_dquot take the write lock, but when the journal lock is
      taken it only drops one the references. The locking rules are that the journal
      lock be acquired before the write lock so leaving the reference open leads
      to a ABBA deadlock.
      
      This patch pushes the unlock up before clear_inode and avoids the recursive
      locking.
      
      Another ABBA situation can occur when the write lock is dropped while reading
      the bitmap buffer while in the quota code. When the lock is reacquired, it
      will deadlock against dquot->dq_lock and dqopt->dqio_mutex in the dquot_acquire
      path. It's safe to retain the lock across the read and should be cached under
      write load.
      Signed-off-by: NJeff Mahoney <jeffm@suse.com>
      Signed-off-by: NJan Kara <jack@suse.cz>
      48d17884
  20. 30 5月, 2012 1 次提交
  21. 06 5月, 2012 1 次提交
  22. 21 3月, 2012 3 次提交
  23. 04 1月, 2012 1 次提交
  24. 02 11月, 2011 1 次提交