1. 04 Mar, 2010 12 commits
    • Christoph Hellwig's avatar
      quota: clean up Q_XQUOTASYNC · 8c4e4acd
      Christoph Hellwig authored
      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: default avatarChristoph Hellwig <hch@lst.de>
      Signed-off-by: default avatarJan Kara <jack@suse.cz>
      8c4e4acd
    • Christoph Hellwig's avatar
      quota: simplify permission checking · c988afb5
      Christoph Hellwig authored
      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: default avatarChristoph Hellwig <hch@lst.de>
      Signed-off-by: default avatarJan Kara <jack@suse.cz>
      c988afb5
    • Christoph Hellwig's avatar
      quota: special case Q_SYNC without device name · 6ae09575
      Christoph Hellwig authored
      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: default avatarChristoph Hellwig <hch@lst.de>
      Signed-off-by: default avatarJan Kara <jack@suse.cz>
      6ae09575
    • Christoph Hellwig's avatar
      quota: clean up checks for supported quota methods · f450d4fe
      Christoph Hellwig authored
      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: default avatarChristoph Hellwig <hch@lst.de>
      Signed-off-by: default avatarJan Kara <jack@suse.cz>
      f450d4fe
    • Christoph Hellwig's avatar
      quota: split do_quotactl · c411e5f6
      Christoph Hellwig authored
      Split out a helper for each non-trivial command from do_quotactl.
      Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
      Signed-off-by: default avatarJan Kara <jack@suse.cz>
      c411e5f6
    • Jan Kara's avatar
      quota: Fix warning when a delayed write happens before quota is enabled · 0a5a9c72
      Jan Kara authored
      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: default avatarJan Kara <jack@suse.cz>
      0a5a9c72
    • Dmitry Monakhov's avatar
      quota: manage reserved space when quota is not active [v2] · c469070a
      Dmitry Monakhov authored
      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: default avatarDmitry Monakhov <dmonakhov@openvz.org>
      Signed-off-by: default avatarJan Kara <jack@suse.cz>
      c469070a
    • Christoph Egger's avatar
      jbd[2]: remove references to BUFFER_DEBUG · c7e8d4d6
      Christoph Egger authored
      CONFIG_BUFFER_DEBUG seems to have been removed from the documentation
      somewhere around 2.4.15 and seemingly hasn't been available even
      longer. It is, however, still referenced at one place from the jbd
      code (one is a copy of the other header). Time to clean it up
      Signed-off-by: default avatarChristoph Egger <siccegge@stud.informatik.uni-erlangen.de>
      Signed-off-by: default avatarJan Kara <jack@suse.cz>
      c7e8d4d6
    • Dmitry Monakhov's avatar
      ext3: trivial quota cleanup · e1f5c67a
      Dmitry Monakhov authored
      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: default avatarDmitry Monakhov <dmonakhov@openvz.org>
      Signed-off-by: default avatarJan Kara <jack@suse.cz>
      e1f5c67a
    • Dmitry Monakhov's avatar
      ext3: mount flags manipulation cleanup · e3c96435
      Dmitry Monakhov authored
      Replace intermediate EXT3_MOUNT_XXX flags manipulation to
      corresponding macro.
      Signed-off-by: default avatarDmitry Monakhov <dmonakhov@openvz.org>
      Signed-off-by: default avatarJan Kara <jack@suse.cz>
      e3c96435
    • Jan Kara's avatar
      ext3: Use bitops to read/modify EXT3_I(inode)->i_state · 9df93939
      Jan Kara authored
      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: default avatarJan Kara <jack@suse.cz>
      9df93939
    • Jan Kara's avatar
      quota: Cleanup S_NOQUOTA handling · 26245c94
      Jan Kara authored
      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: default avatarJan Kara <jack@suse.cz>
      26245c94
  2. 02 Mar, 2010 12 commits
  3. 01 Mar, 2010 16 commits