1. 16 5月, 2012 3 次提交
  2. 01 3月, 2012 2 次提交
    • J
      quota: Make quota code not call tty layer with dqptr_sem held · bf097aaf
      Jan Kara 提交于
      dqptr_sem can be called from slab reclaim. tty layer uses GFP_KERNEL mask for
      allocation so it can end up calling slab reclaim. Given quota code can call
      into tty layer to print warning this creates possibility for lock inversion
      between tty->atomic_write_lock and dqptr_sem.
      
      Using direct printing of warnings from quota layer is obsolete but since it's
      easy enough to change quota code to not hold any locks when printing warnings,
      let's just do it. It seems like a good thing to do even when we use netlink
      layer to transmit warnings to userspace.
      Reported-by: NMarkus <M4rkusXXL@web.de>
      Signed-off-by: NJan Kara <jack@suse.cz>
      bf097aaf
    • C
      quota: make Q_XQUOTASYNC a noop · 4b217ed9
      Christoph Hellwig 提交于
      Now that XFS takes quota reservations into account there is no need to flush
      anything before reporting quotas - in addition to beeing fully transactional
      all quota information is also 100% coherent with the rest of the filesystem
      now.
      Reviewed-by: NDave Chinner <dchinner@redhat.com>
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NBen Myers <bpm@sgi.com>
      4b217ed9
  3. 14 2月, 2012 2 次提交
  4. 12 1月, 2012 1 次提交
  5. 07 1月, 2012 1 次提交
  6. 04 1月, 2012 1 次提交
  7. 01 11月, 2011 1 次提交
  8. 31 10月, 2011 1 次提交
    • C
      writeback: Add a 'reason' to wb_writeback_work · 0e175a18
      Curt Wohlgemuth 提交于
      This creates a new 'reason' field in a wb_writeback_work
      structure, which unambiguously identifies who initiates
      writeback activity.  A 'wb_reason' enumeration has been
      added to writeback.h, to enumerate the possible reasons.
      
      The 'writeback_work_class' and tracepoint event class and
      'writeback_queue_io' tracepoints are updated to include the
      symbolic 'reason' in all trace events.
      
      And the 'writeback_inodes_sbXXX' family of routines has had
      a wb_stats parameter added to them, so callers can specify
      why writeback is being started.
      Acked-by: NJan Kara <jack@suse.cz>
      Signed-off-by: NCurt Wohlgemuth <curtw@google.com>
      Signed-off-by: NWu Fengguang <fengguang.wu@intel.com>
      0e175a18
  9. 27 9月, 2011 1 次提交
  10. 25 5月, 2011 1 次提交
  11. 01 4月, 2011 1 次提交
    • J
      quota: Don't write quota info in dquot_commit() · b03f2456
      Jan Kara 提交于
      There's no reason to write quota info in dquot_commit(). The writing is a
      relict from the old days when we didn't have dquot_acquire() and
      dquot_release() and thus dquot_commit() could have created / removed quota
      structures from the file. These days dquot_commit() only updates usage counters
      / limits in quota structure and thus there's no need to write quota info.
      
      This also fixes an issue with journaling filesystem which didn't reserve
      enough space in the transaction for write of quota info (it could have been
      dirty at the time of dquot_commit() because of a race with other operation
      changing it).
      
      CC: stable@kernel.org
      Reported-and-tested-by: NLukas Czerner <lczerner@redhat.com>
      Signed-off-by: NJan Kara <jack@suse.cz>
      b03f2456
  12. 31 3月, 2011 1 次提交
  13. 25 3月, 2011 2 次提交
    • D
      fs: move i_sb_list out from under inode_lock · 55fa6091
      Dave Chinner 提交于
      Protect the per-sb inode list with a new global lock
      inode_sb_list_lock and use it to protect the list manipulations and
      traversals. This lock replaces the inode_lock as the inodes on the
      list can be validity checked while holding the inode->i_lock and
      hence the inode_lock is no longer needed to protect the list.
      Signed-off-by: NDave Chinner <dchinner@redhat.com>
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      55fa6091
    • D
      fs: protect inode->i_state with inode->i_lock · 250df6ed
      Dave Chinner 提交于
      Protect inode state transitions and validity checks with the
      inode->i_lock. This enables us to make inode state transitions
      independently of the inode_lock and is the first step to peeling
      away the inode_lock from the code.
      
      This requires that __iget() is done atomically with i_state checks
      during list traversals so that we don't race with another thread
      marking the inode I_FREEING between the state check and grabbing the
      reference.
      
      Also remove the unlock_new_inode() memory barrier optimisation
      required to avoid taking the inode_lock when clearing I_NEW.
      Simplify the code by simply taking the inode->i_lock around the
      state change and wakeup. Because the wakeup is no longer tricky,
      remove the wake_up_inode() function and open code the wakeup where
      necessary.
      Signed-off-by: NDave Chinner <dchinner@redhat.com>
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      250df6ed
  14. 24 2月, 2011 1 次提交
  15. 13 1月, 2011 1 次提交
    • J
      quota: Fix deadlock during path resolution · f00c9e44
      Jan Kara 提交于
      As Al Viro pointed out path resolution during Q_QUOTAON calls to quotactl
      is prone to deadlocks. We hold s_umount semaphore for reading during the
      path resolution and resolution itself may need to acquire the semaphore
      for writing when e. g. autofs mountpoint is passed.
      
      Solve the problem by performing the resolution before we get hold of the
      superblock (and thus s_umount semaphore). The whole thing is complicated
      by the fact that some filesystems (OCFS2) ignore the path argument. So to
      distinguish between filesystem which want the path and which do not we
      introduce new .quota_on_meta callback which does not get the path. OCFS2
      then uses this callback instead of old .quota_on.
      
      CC: Al Viro <viro@ZenIV.linux.org.uk>
      CC: Christoph Hellwig <hch@lst.de>
      CC: Ted Ts'o <tytso@mit.edu>
      CC: Joel Becker <joel.becker@oracle.com>
      Signed-off-by: NJan Kara <jack@suse.cz>
      f00c9e44
  16. 11 1月, 2011 1 次提交
  17. 28 10月, 2010 3 次提交
    • J
      quota: Fix possible oops in __dquot_initialize() · 4408ea41
      Jan Kara 提交于
      When quotaon(8) races with __dquot_initialize() or dqget() fails because
      of EIO, ENOSPC, or similar error, we could possibly dereference NULL pointer
      in inode->i_dquot[cnt]. Add proper checking.
      Reported-by: NDmitry Monakhov <dmonakhov@gmail.com>
      Signed-off-by: NJan Kara <jack@suse.cz>
      4408ea41
    • J
      quota: Fix issuing of warnings from dquot_transfer · 86f3cbec
      Jan Kara 提交于
      __dquot_transfer accidentally called flush_warnings for a wrong set of
      dquots which could result in quota warnings being issued with a wrong
      identification. Also when operation fails because of EDQUOT, there's no
      need check for issuing information message about user getting below limits
      (no transfer has actually happened).
      Signed-off-by: NJan Kara <jack@suse.cz>
      86f3cbec
    • D
      quota: fix dquot_disable vs dquot_transfer race v2 · 9e32784b
      Dmitry 提交于
      I've got following lockup:
      dquot_disable                              dquot_transfer
                                                  ->dqget()
      					       sb_has_quota_active
      dqopt->flags &= ~dquot_state_flag(f, cnt)      atomic_inc(dq->dq_count)
       ->drop_dquot_ref(sb, cnt);
          down_write(dqptr_sem)
          inode->i_dquot[cnt] = NULL              ->__dquot_transfer
      invalidate_dquots(sb, cnt);		       down_write(&dqptr_sem)
        ->wait for dq_wait_unused		       inode->i_dquot = new_dquot
        /* wait forever */                            ^^^^New quota user^^^^^^
      
      We cannot allow new references to dquots from inodes after drop_dquot_ref()
      has removed them.  We have to recheck quota state under dqptr_sem and before
      assignment, as we do it in dquot_initialize().
      Signed-off-by: NDmitry Monakhov <dmonakhov@gmail.com>
      Signed-off-by: NJan Kara <jack@suse.cz>
      9e32784b
  18. 05 10月, 2010 1 次提交
  19. 10 8月, 2010 1 次提交
    • A
      simplify checks for I_CLEAR/I_FREEING · a4ffdde6
      Al Viro 提交于
      add I_CLEAR instead of replacing I_FREEING with it.  I_CLEAR is
      equivalent to I_FREEING for almost all code looking at either;
      it's there to keep track of having called clear_inode() exactly
      once per inode lifetime, at some point after having set I_FREEING.
      I_CLEAR and I_FREEING never get set at the same time with the
      current code, so we can switch to setting i_flags to I_FREEING | I_CLEAR
      instead of I_CLEAR without loss of information.  As the result of
      such change, checks become simpler and the amount of code that needs
      to know about I_CLEAR shrinks a lot.
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      a4ffdde6
  20. 23 7月, 2010 1 次提交
  21. 21 7月, 2010 4 次提交
  22. 19 7月, 2010 1 次提交
    • D
      mm: add context argument to shrinker callback · 7f8275d0
      Dave Chinner 提交于
      The current shrinker implementation requires the registered callback
      to have global state to work from. This makes it difficult to shrink
      caches that are not global (e.g. per-filesystem caches). Pass the shrinker
      structure to the callback so that users can embed the shrinker structure
      in the context the shrinker needs to operate on and get back to it in the
      callback via container_of().
      Signed-off-by: NDave Chinner <dchinner@redhat.com>
      Reviewed-by: NChristoph Hellwig <hch@lst.de>
      7f8275d0
  23. 28 5月, 2010 1 次提交
  24. 27 5月, 2010 1 次提交
  25. 24 5月, 2010 4 次提交
  26. 22 5月, 2010 2 次提交