1. 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
  2. 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
  3. 23 7月, 2010 1 次提交
  4. 21 7月, 2010 4 次提交
  5. 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
  6. 28 5月, 2010 1 次提交
  7. 27 5月, 2010 1 次提交
  8. 24 5月, 2010 4 次提交
  9. 22 5月, 2010 7 次提交
  10. 16 5月, 2010 2 次提交
  11. 21 4月, 2010 1 次提交
    • J
      quota: Convert __DQUOT_PARANOIA symbol to standard config option · 62af9b52
      Jan Kara 提交于
      Make __DQUOT_PARANOIA define from the old days a standard config option
      and turn it off by default.
      
      This gets rid of a quota warning about writes before quota is turned on
      for systems with ext4 root filesystem. Currently there's no way to legally
      solve this because /etc/mtab has to be written before quota is turned on
      on most systems.
      Signed-off-by: NJan Kara <jack@suse.cz>
      62af9b52
  12. 13 4月, 2010 2 次提交
  13. 05 3月, 2010 12 次提交
    • C
      quota: stop using QUOTA_OK / NO_QUOTA · efd8f0e6
      Christoph Hellwig 提交于
      Just use 0 / -EDQUOT directly - that's what it translates to anyway.
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NJan Kara <jack@suse.cz>
      efd8f0e6
    • C
      dquot: cleanup dquot initialize routine · 871a2931
      Christoph Hellwig 提交于
      Get rid of the initialize dquot operation - it is now always called from
      the filesystem and if a filesystem really needs it's own (which none
      currently does) it can just call into it's own routine directly.
      
      Rename the now static low-level dquot_initialize helper to __dquot_initialize
      and vfs_dq_init to dquot_initialize to have a consistent namespace.
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NJan Kara <jack@suse.cz>
      871a2931
    • C
      dquot: move dquot initialization responsibility into the filesystem · 907f4554
      Christoph Hellwig 提交于
      Currently various places in the VFS call vfs_dq_init directly.  This means
      we tie the quota code into the VFS.  Get rid of that and make the
      filesystem responsible for the initialization.   For most metadata operations
      this is a straight forward move into the methods, but for truncate and
      open it's a bit more complicated.
      
      For truncate we currently only call vfs_dq_init for the sys_truncate case
      because open already takes care of it for ftruncate and open(O_TRUNC) - the
      new code causes an additional vfs_dq_init for those which is harmless.
      
      For open the initialization is moved from do_filp_open into the open method,
      which means it happens slightly earlier now, and only for regular files.
      The latter is fine because we don't need to initialize it for operations
      on special files, and we already do it as part of the namespace operations
      for directories.
      
      Add a dquot_file_open helper that filesystems that support generic quotas
      can use to fill in ->open.
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NJan Kara <jack@suse.cz>
      907f4554
    • C
      dquot: cleanup dquot drop routine · 9f754758
      Christoph Hellwig 提交于
      Get rid of the drop dquot operation - it is now always called from
      the filesystem and if a filesystem really needs it's own (which none
      currently does) it can just call into it's own routine directly.
      
      Rename the now static low-level dquot_drop helper to __dquot_drop
      and vfs_dq_drop to dquot_drop to have a consistent namespace.
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NJan Kara <jack@suse.cz>
      9f754758
    • C
      dquot: cleanup dquot transfer routine · b43fa828
      Christoph Hellwig 提交于
      Get rid of the transfer dquot operation - it is now always called from
      the filesystem and if a filesystem really needs it's own (which none
      currently does) it can just call into it's own routine directly.
      
      Rename the now static low-level dquot_transfer helper to __dquot_transfer
      and vfs_dq_transfer to dquot_transfer to have a consistent namespace,
      and make the new dquot_transfer return a normal negative errno value
      which all callers expect.
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NJan Kara <jack@suse.cz>
      b43fa828
    • C
      dquot: cleanup inode allocation / freeing routines · 63936dda
      Christoph Hellwig 提交于
      Get rid of the alloc_inode and free_inode dquot operations - they are
      always called from the filesystem and if a filesystem really needs
      their own (which none currently does) it can just call into it's
      own routine directly.
      
      Also get rid of the vfs_dq_alloc/vfs_dq_free wrappers and always
      call the lowlevel dquot_alloc_inode / dqout_free_inode routines
      directly, which now lose the number argument which is always 1.
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NJan Kara <jack@suse.cz>
      63936dda
    • C
      dquot: cleanup space allocation / freeing routines · 5dd4056d
      Christoph Hellwig 提交于
      Get rid of the alloc_space, free_space, reserve_space, claim_space and
      release_rsv dquot operations - they are always called from the filesystem
      and if a filesystem really needs their own (which none currently does)
      it can just call into it's own routine directly.
      
      Move shared logic into the common __dquot_alloc_space,
      dquot_claim_space_nodirty and __dquot_free_space low-level methods,
      and rationalize the wrappers around it to move as much as possible
      code into the common block for CONFIG_QUOTA vs not.  Also rename
      all these helpers to be named dquot_* instead of vfs_dq_*.
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NJan Kara <jack@suse.cz>
      5dd4056d
    • J
      quota: Properly invalidate caches even for filesystems with blocksize < pagesize · ab94c39b
      Jan Kara 提交于
      Sometimes invalidate_bdev() can fail to invalidate a part of block
      device cache because of dirty data. If the filesystem has blocksize
      smaller than page size, this can happen even for pages containing
      quota files and thus kernel would operate on stale data. Fix the
      issue by syncing the filesystem before invalidating the cache.
      Reviewed-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NJan Kara <jack@suse.cz>
      ab94c39b
    • D
      quota: generalize quota transfer interface · 8ddd69d6
      Dmitry Monakhov 提交于
      Current quota transfer interface support only uid/gid.
      This patch extend interface in order to support various quotas types
      The goal is accomplished without changes in most frequently used
      vfs_dq_transfer() func.
      Signed-off-by: NDmitry Monakhov <dmonakhov@openvz.org>
      Signed-off-by: NJan Kara <jack@suse.cz>
      8ddd69d6
    • D
      quota: sb_quota state flags cleanup · ad1e6e8d
      Dmitry Monakhov 提交于
      - remove hardcoded USRQUOTA/GRPQUOTA flags
      - convert int to bool for appropriate functions
      Signed-off-by: NDmitry Monakhov <dmonakhov@openvz.org>
      Signed-off-by: NJan Kara <jack@suse.cz>
      ad1e6e8d
    • C
      quota: move code from sync_quota_sb into vfs_quota_sync · 5fb324ad
      Christoph Hellwig 提交于
      Currenly sync_quota_sb does a lot of sync and truncate action that only
      applies to "VFS" style quotas and is actively harmful for the sync
      performance in XFS.  Move it into vfs_quota_sync and add a wait parameter
      to ->quota_sync to tell if we need it or not.
      
      My audit of the GFS2 code says it's also not needed given the way GFS2
      implements quotas, but I'd be happy if this can get a detailed review.
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NJan Kara <jack@suse.cz>
      5fb324ad
    • 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
新手
引导
客服 返回
顶部