1. 05 3月, 2010 11 次提交
    • C
      quota: clean up Q_XQUOTASYNC · 8c4e4acd
      Christoph Hellwig 提交于
      Currently Q_XQUOTASYNC calls into the quota_sync method, but XFS does something
      entirely different in it than the rest of the filesystems.  xfs_quota which
      calls Q_XQUOTASYNC expects an asynchronous data writeout to flush delayed
      allocations, while the "VFS" quota support wants to flush changes to the quota
      file.
      
      So make Q_XQUOTASYNC call into the writeback code directly and make the
      quota_sync method optional as XFS doesn't need in the sense expected by the
      rest of the quota code.
      
      GFS2 was using limited XFS-style quota and has a quota_sync method fitting
      neither the style used by vfs_quota_sync nor xfs_fs_quota_sync.  I left it
      in for now as per discussion with Steve it expects to be called from the
      sync path this way.
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NJan Kara <jack@suse.cz>
      8c4e4acd
    • C
      quota: simplify permission checking · c988afb5
      Christoph Hellwig 提交于
      Stop having complicated different routines for checking permissions for
      XQM vs "VFS" quotas.  Instead do the checks for having sb->s_qcop and
      a valid type directly in do_quotactl, and munge the *quotactl_valid functions
      into a check_quotactl_permission helper that only checks for permissions.
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NJan Kara <jack@suse.cz>
      c988afb5
    • C
      quota: special case Q_SYNC without device name · 6ae09575
      Christoph Hellwig 提交于
      The Q_SYNC command can be called without the path to a device, in which case
      it iterates over all superblocks.  Special case this variant directly in
      sys_quotactl so that the other code always gets a superblock and doesn't
      need to deal with this case.
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NJan Kara <jack@suse.cz>
      6ae09575
    • C
      quota: clean up checks for supported quota methods · f450d4fe
      Christoph Hellwig 提交于
      Move the checks for sb->s_qcop->foo next to the actual calls for them, same
      for sb_has_quota_active checks where applicable.
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NJan Kara <jack@suse.cz>
      f450d4fe
    • C
      quota: split do_quotactl · c411e5f6
      Christoph Hellwig 提交于
      Split out a helper for each non-trivial command from do_quotactl.
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NJan Kara <jack@suse.cz>
      c411e5f6
    • J
      quota: Fix warning when a delayed write happens before quota is enabled · 0a5a9c72
      Jan Kara 提交于
      If a delayed-allocation write happens before quota is enabled, the
      kernel spits out a warning:
      WARNING: at fs/quota/dquot.c:988 dquot_claim_space+0x77/0x112()
      
      because the fact that user has some delayed allocation is not recorded
      in quota structure.
      
      Make dquot_initialize() update amount of reserved space for user if it sees
      inode has some space reserved. Also make sure that reserved quota space does
      not go negative and we warn about the filesystem bug just once.
      Signed-off-by: NJan Kara <jack@suse.cz>
      0a5a9c72
    • D
      quota: manage reserved space when quota is not active [v2] · c469070a
      Dmitry Monakhov 提交于
      Since we implemented generic reserved space management interface,
      then it is possible to account reserved space even when quota
      is not active (similar to i_blocks/i_bytes).
      
      Without this patch following testcase result in massive comlain from
      WARN_ON in dquot_claim_space()
      
      TEST_CASE:
      mount /dev/sdb /mnt -oquota
      dd if=/dev/zero of=/mnt/test bs=1M count=1
      quotaon /mnt
      # fs_reserved_spave == 1Mb
      # quota_reserved_space == 0, because quota was disabled
      dd if=/dev/zero of=/mnt/test seek=1 bs=1M count=1
      # fs_reserved_spave == 2Mb
      # quota_reserved_space == 1Mb
      sync  # ->dquot_claim_space() -> WARN_ON
      Signed-off-by: NDmitry Monakhov <dmonakhov@openvz.org>
      Signed-off-by: NJan Kara <jack@suse.cz>
      c469070a
    • D
      ext3: trivial quota cleanup · e1f5c67a
      Dmitry Monakhov 提交于
      The patch is aimed to reorganize and simplify quota code a bit.
      Quota code is itself complex enouth, but we can make it more readable
      in some places:
      - Move quota option parsing to separate functions.
      - Simplify old-quota and journaled-quota mix check.
      Signed-off-by: NDmitry Monakhov <dmonakhov@openvz.org>
      Signed-off-by: NJan Kara <jack@suse.cz>
      e1f5c67a
    • D
      ext3: mount flags manipulation cleanup · e3c96435
      Dmitry Monakhov 提交于
      Replace intermediate EXT3_MOUNT_XXX flags manipulation to
      corresponding macro.
      Signed-off-by: NDmitry Monakhov <dmonakhov@openvz.org>
      Signed-off-by: NJan Kara <jack@suse.cz>
      e3c96435
    • J
      ext3: Use bitops to read/modify EXT3_I(inode)->i_state · 9df93939
      Jan Kara 提交于
      At several places we modify EXT3_I(inode)->i_state without holding i_mutex
      (ext3_release_file, ext3_bmap, ext3_journalled_writepage, ext3_do_update_inode,
      ...). These modifications are racy and we can lose updates to i_state. So
      convert handling of i_state to use bitops which are atomic.
      Signed-off-by: NJan Kara <jack@suse.cz>
      9df93939
    • J
      quota: Cleanup S_NOQUOTA handling · 26245c94
      Jan Kara 提交于
      Cleanup handling of S_NOQUOTA inode flag and document it a bit. The flag
      does not have to be set under dqptr_sem. Only functions modifying inode's
      dquot pointers have to check the flag under dqptr_sem before going forward
      with the modification. This way we are sure that we cannot add new dquot
      pointers to the inode which is just becoming a quota file.
      
      The good thing about this cleanup is that there are no more places in quota
      code which enforce i_mutex vs. dqptr_sem lock ordering (in particular that
      dqptr_sem -> i_mutex of quota file). This should silence some (false) lockdep
      warnings with ext4 + quota and generally make life of some filesystems easier.
      Signed-off-by: NJan Kara <jack@suse.cz>
      26245c94
  2. 03 3月, 2010 1 次提交
  3. 01 3月, 2010 1 次提交
  4. 27 2月, 2010 4 次提交
  5. 26 2月, 2010 1 次提交
  6. 25 2月, 2010 2 次提交
    • P
      vfs: Apply lockdep-based checking to rcu_dereference() uses · 7dc52157
      Paul E. McKenney 提交于
      Add lockdep-ified RCU primitives to alloc_fd(), files_fdtable()
      and fcheck_files().
      
      Cc: Alexander Viro <viro@zeniv.linux.org.uk>
      Signed-off-by: NPaul E. McKenney <paulmck@linux.vnet.ibm.com>
      Cc: laijs@cn.fujitsu.com
      Cc: dipankar@in.ibm.com
      Cc: mathieu.desnoyers@polymtl.ca
      Cc: josh@joshtriplett.org
      Cc: dvhltc@us.ibm.com
      Cc: niv@us.ibm.com
      Cc: peterz@infradead.org
      Cc: rostedt@goodmis.org
      Cc: Valdis.Kletnieks@vt.edu
      Cc: dhowells@redhat.com
      Cc: Alexander Viro <viro@zeniv.linux.org.uk>
      LKML-Reference: <1266887105-1528-8-git-send-email-paulmck@linux.vnet.ibm.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      7dc52157
    • D
      dlm: fix ordering of bast and cast · 7fe2b319
      David Teigland 提交于
      When both blocking and completion callbacks are queued for lock,
      the dlm would always deliver the completion callback (cast) first.
      In some cases the blocking callback (bast) is queued before the
      cast, though, and should be delivered first.  This patch keeps
      track of the order in which they were queued and delivers them
      in that order.
      
      This patch also keeps track of the granted mode in the last cast
      and eliminates the following bast if the bast mode is compatible
      with the preceding cast mode.  This happens when a remotely mastered
      lock is demoted, e.g. EX->NL, in which case the local node queues
      a cast immediately after sending the demote message.  In this way
      a cast can be queued for a mode, e.g. NL, that makes an in-transit
      bast extraneous.
      Signed-off-by: NDavid Teigland <teigland@redhat.com>
      7fe2b319
  7. 23 2月, 2010 2 次提交
  8. 20 2月, 2010 2 次提交
  9. 19 2月, 2010 2 次提交
  10. 17 2月, 2010 1 次提交
  11. 16 2月, 2010 1 次提交
    • C
      NFS: Too many GETATTR and ACCESS calls after direct I/O · 65d26953
      Chuck Lever 提交于
      The cached read and write paths initialize fattr->time_start in their
      setup procedures.  The value of fattr->time_start is propagated to
      read_cache_jiffies by nfs_update_inode().  Subsequent calls to
      nfs_attribute_timeout() will then use a good time stamp when
      computing the attribute cache timeout, and squelch unneeded GETATTR
      calls.
      
      Since the direct I/O paths erroneously leave the inode's
      fattr->time_start field set to zero, read_cache_jiffies for that inode
      is set to zero after any direct read or write operation.  This
      triggers an otw GETATTR or ACCESS call to update the file's attribute
      and access caches properly, even when the NFS READ or WRITE replies
      have usable post-op attributes.
      
      Make sure the direct read and write setup code performs the same fattr
      initialization as the cached I/O paths to prevent unnecessary GETATTR
      calls.
      
      This was likely introduced by commit 0e574af1 in 2.6.15, which appears
      to add new nfs_fattr_init() call sites in the cached read and write
      paths, but not in the equivalent places in fs/nfs/direct.c.  A
      subsequent commit in the same series, 33801147, introduces the
      fattr->time_start field.
      
      Interestingly, the direct write reschedule path already has a call to
      nfs_fattr_init() in the right place.
      Reported-by: NQuentin Barnes <qbarnes@yahoo-inc.com>
      Signed-off-by: NChuck Lever <chuck.lever@oracle.com>
      Cc: stable@kernel.org
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      65d26953
  12. 15 2月, 2010 1 次提交
  13. 14 2月, 2010 2 次提交
  14. 13 2月, 2010 3 次提交
  15. 12 2月, 2010 4 次提交
  16. 11 2月, 2010 1 次提交
  17. 10 2月, 2010 1 次提交