1. 17 5月, 2010 6 次提交
  2. 16 5月, 2010 3 次提交
    • E
      ext4: don't use quota reservation for speculative metadata · 72b8ab9d
      Eric Sandeen 提交于
      Because we can badly over-reserve metadata when we
      calculate worst-case, it complicates things for quota, since
      we must reserve and then claim later, retry on EDQUOT, etc.
      Quota is also a generally smaller pool than fs free blocks,
      so this over-reservation hurts more, and more often.
      
      I'm of the opinion that it's not the worst thing to allow
      metadata to push a user slightly over quota.  This simplifies
      the code and avoids the false quota rejections that result
      from worst-case speculation.
      
      This patch stops the speculative quota-charging for
      worst-case metadata requirements, and just charges quota
      when the blocks are allocated at writeout.  It also is
      able to remove the try-again loop on EDQUOT.
      
      This patch has been tested indirectly by running the xfstests
      suite with a hack to mount & enable quota prior to the test.
      
      I also did a more specific test of fragmenting freespace
      and then doing a large delalloc write under quota; quota
      stopped me at the right amount of file IO, and then the
      writeout generated enough metadata (due to the fragmentation)
      that it put me slightly over quota, as expected.
      Signed-off-by: NEric Sandeen <sandeen@redhat.com>
      Signed-off-by: N"Theodore Ts'o" <tytso@mit.edu>
      72b8ab9d
    • E
      ext4: don't scan/accumulate more pages than mballoc will allocate · c445e3e0
      Eric Sandeen 提交于
      There was a bug reported on RHEL5 that a 10G dd on a 12G box
      had a very, very slow sync after that.
      
      At issue was the loop in write_cache_pages scanning all the way
      to the end of the 10G file, even though the subsequent call
      to mpage_da_submit_io would only actually write a smallish amt; then
      we went back to the write_cache_pages loop ... wasting tons of time
      in calling __mpage_da_writepage for thousands of pages we would
      just revisit (many times) later.
      
      Upstream it's not such a big issue for sys_sync because we get
      to the loop with a much smaller nr_to_write, which limits the loop.
      
      However, talking with Aneesh he realized that fsync upstream still
      gets here with a very large nr_to_write and we face the same problem.
      
      This patch makes mpage_add_bh_to_extent stop the loop after we've
      accumulated 2048 pages, by setting mpd->io_done = 1; which ultimately
      causes the write_cache_pages loop to break.
      
      Repeating the test with a dirty_ratio of 80 (to leave something for
      fsync to do), I don't see huge IO performance gains, but the reduction
      in cpu usage is striking: 80% usage with stock, and 2% with the
      below patch.  Instrumenting the loop in write_cache_pages clearly
      shows that we are wasting time here.
      
      Eventually we need to change mpage_da_map_pages() also submit its I/O
      to the block layer, subsuming mpage_da_submit_io(), and then change it
      call ext4_get_blocks() multiple times.
      Signed-off-by: NEric Sandeen <sandeen@redhat.com>
      Signed-off-by: N"Theodore Ts'o" <tytso@mit.edu>
      c445e3e0
    • D
      ext4: fix quota accounting in case of fallocate · 35121c98
      Dmitry Monakhov 提交于
      allocated_meta_data is already included in 'used' variable.
      Signed-off-by: NDmitry Monakhov <dmonakhov@openvz.org>
      Signed-off-by: N"Theodore Ts'o" <tytso@mit.edu>
      35121c98
  3. 04 4月, 2010 2 次提交
    • C
      ext4: Fix buffer head leaks after calls to ext4_get_inode_loc() · fd2dd9fb
      Curt Wohlgemuth 提交于
      Calls to ext4_get_inode_loc() returns with a reference to a buffer
      head in iloc->bh.  The callers of this function in ext4_write_inode()
      when in no journal mode and in ext4_xattr_fiemap() don't release the
      buffer head after using it.
      
      Addresses-Google-Bug: #2548165
      Signed-off-by: NCurt Wohlgemuth <curtw@google.com>
      Signed-off-by: N"Theodore Ts'o" <tytso@mit.edu>
      fd2dd9fb
    • C
      ext4: Fix possible lost inode write in no journal mode · 8b472d73
      Curt Wohlgemuth 提交于
      In the no-journal case, ext4_write_inode() will fetch the bh and call
      sync_dirty_buffer() on it.  However, if the bh has already been
      written and the bh reclaimed for some other purpose, AND if the inode
      is the only one in the inode table block in use, then
      ext4_get_inode_loc() will not read the inode table block from disk,
      but as an optimization, fill the block with zero's assuming that its
      caller will copy in the on-disk version of the inode.  This is not
      done by ext4_write_inode(), so the contents of the inode can simply
      get lost.  The fix is to use __ext4_get_inode_loc() with in_mem set to
      0, instead of ext4_get_inode_loc().  Long term the API needs to be
      fixed so it's obvious why latter is not safe.
      
      Addresses-Google-Bug: #2526446
      Signed-off-by: NCurt Wohlgemuth <curtw@google.com>
      Signed-off-by: N"Theodore Ts'o" <tytso@mit.edu>
      8b472d73
  4. 30 3月, 2010 1 次提交
    • T
      include cleanup: Update gfp.h and slab.h includes to prepare for breaking... · 5a0e3ad6
      Tejun Heo 提交于
      include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h
      
      percpu.h is included by sched.h and module.h and thus ends up being
      included when building most .c files.  percpu.h includes slab.h which
      in turn includes gfp.h making everything defined by the two files
      universally available and complicating inclusion dependencies.
      
      percpu.h -> slab.h dependency is about to be removed.  Prepare for
      this change by updating users of gfp and slab facilities include those
      headers directly instead of assuming availability.  As this conversion
      needs to touch large number of source files, the following script is
      used as the basis of conversion.
      
        http://userweb.kernel.org/~tj/misc/slabh-sweep.py
      
      The script does the followings.
      
      * Scan files for gfp and slab usages and update includes such that
        only the necessary includes are there.  ie. if only gfp is used,
        gfp.h, if slab is used, slab.h.
      
      * When the script inserts a new include, it looks at the include
        blocks and try to put the new include such that its order conforms
        to its surrounding.  It's put in the include block which contains
        core kernel includes, in the same order that the rest are ordered -
        alphabetical, Christmas tree, rev-Xmas-tree or at the end if there
        doesn't seem to be any matching order.
      
      * If the script can't find a place to put a new include (mostly
        because the file doesn't have fitting include block), it prints out
        an error message indicating which .h file needs to be added to the
        file.
      
      The conversion was done in the following steps.
      
      1. The initial automatic conversion of all .c files updated slightly
         over 4000 files, deleting around 700 includes and adding ~480 gfp.h
         and ~3000 slab.h inclusions.  The script emitted errors for ~400
         files.
      
      2. Each error was manually checked.  Some didn't need the inclusion,
         some needed manual addition while adding it to implementation .h or
         embedding .c file was more appropriate for others.  This step added
         inclusions to around 150 files.
      
      3. The script was run again and the output was compared to the edits
         from #2 to make sure no file was left behind.
      
      4. Several build tests were done and a couple of problems were fixed.
         e.g. lib/decompress_*.c used malloc/free() wrappers around slab
         APIs requiring slab.h to be added manually.
      
      5. The script was run on all .h files but without automatically
         editing them as sprinkling gfp.h and slab.h inclusions around .h
         files could easily lead to inclusion dependency hell.  Most gfp.h
         inclusion directives were ignored as stuff from gfp.h was usually
         wildly available and often used in preprocessor macros.  Each
         slab.h inclusion directive was examined and added manually as
         necessary.
      
      6. percpu.h was updated not to include slab.h.
      
      7. Build test were done on the following configurations and failures
         were fixed.  CONFIG_GCOV_KERNEL was turned off for all tests (as my
         distributed build env didn't work with gcov compiles) and a few
         more options had to be turned off depending on archs to make things
         build (like ipr on powerpc/64 which failed due to missing writeq).
      
         * x86 and x86_64 UP and SMP allmodconfig and a custom test config.
         * powerpc and powerpc64 SMP allmodconfig
         * sparc and sparc64 SMP allmodconfig
         * ia64 SMP allmodconfig
         * s390 SMP allmodconfig
         * alpha SMP allmodconfig
         * um on x86_64 SMP allmodconfig
      
      8. percpu.h modifications were reverted so that it could be applied as
         a separate patch and serve as bisection point.
      
      Given the fact that I had only a couple of failures from tests on step
      6, I'm fairly confident about the coverage of this conversion patch.
      If there is a breakage, it's likely to be something in one of the arch
      headers which should be easily discoverable easily on most builds of
      the specific arch.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Guess-its-ok-by: NChristoph Lameter <cl@linux-foundation.org>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>
      5a0e3ad6
  5. 15 3月, 2010 1 次提交
  6. 06 3月, 2010 1 次提交
  7. 05 3月, 2010 4 次提交
    • 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 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 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
  8. 04 3月, 2010 1 次提交
  9. 03 3月, 2010 2 次提交
  10. 05 3月, 2010 1 次提交
    • J
      ext4: use ext4_get_block_write in buffer write · 744692dc
      Jiaying Zhang 提交于
      Allocate uninitialized extent before ext4 buffer write and
      convert the extent to initialized after io completes.
      The purpose is to make sure an extent can only be marked
      initialized after it has been written with new data so
      we can safely drop the i_mutex lock in ext4 DIO read without
      exposing stale data. This helps to improve multi-thread DIO
      read performance on high-speed disks.
      
      Skip the nobh and data=journal mount cases to make things simple for now.
      Signed-off-by: NJiaying Zhang <jiayingz@google.com>
      Signed-off-by: N"Theodore Ts'o" <tytso@mit.edu>
      744692dc
  11. 03 3月, 2010 1 次提交
  12. 02 3月, 2010 1 次提交
  13. 24 2月, 2010 1 次提交
  14. 17 2月, 2010 1 次提交
    • C
      ext4: Fix BUG_ON at fs/buffer.c:652 in no journal mode · 73b50c1c
      Curt Wohlgemuth 提交于
      Calls to ext4_handle_dirty_metadata should only pass in an inode
      pointer for inode-specific metadata, and not for shared metadata
      blocks such as inode table blocks, block group descriptors, the
      superblock, etc.
      
      The BUG_ON can get tripped when updating a special device (such as a
      block device) that is opened (so that i_mapping is set in
      fs/block_dev.c) and the file system is mounted in no journal mode.
      
      Addresses-Google-Bug: #2404870
      Signed-off-by: NCurt Wohlgemuth <curtw@google.com>
      Signed-off-by: N"Theodore Ts'o" <tytso@mit.edu>
      73b50c1c
  15. 16 2月, 2010 1 次提交
  16. 25 1月, 2010 1 次提交
    • T
      ext4: Use bitops to read/modify EXT4_I(inode)->i_state · 19f5fb7a
      Theodore Ts'o 提交于
      At several places we modify EXT4_I(inode)->i_state without holding
      i_mutex (ext4_release_file, ext4_bmap, ext4_journalled_writepage,
      ext4_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.
      
      Cc: Jan Kara <jack@suse.cz>
      Signed-off-by: N"Theodore Ts'o" <tytso@mit.edu>
      19f5fb7a
  17. 15 1月, 2010 1 次提交
  18. 25 1月, 2010 1 次提交
  19. 23 1月, 2010 1 次提交
  20. 01 1月, 2010 2 次提交
    • T
      ext4: Calculate metadata requirements more accurately · 9d0be502
      Theodore Ts'o 提交于
      In the past, ext4_calc_metadata_amount(), and its sub-functions
      ext4_ext_calc_metadata_amount() and ext4_indirect_calc_metadata_amount()
      badly over-estimated the number of metadata blocks that might be
      required for delayed allocation blocks.  This didn't matter as much
      when functions which managed the reserved metadata blocks were more
      aggressive about dropping reserved metadata blocks as delayed
      allocation blocks were written, but unfortunately they were too
      aggressive.  This was fixed in commit 0637c6f4, but as a result the
      over-estimation by ext4_calc_metadata_amount() would lead to reserving
      2-3 times the number of pending delayed allocation blocks as
      potentially required metadata blocks.  So if there are 1 megabytes of
      blocks which have been not yet been allocation, up to 3 megabytes of
      space would get reserved out of the user's quota and from the file
      system free space pool until all of the inode's data blocks have been
      allocated.
      
      This commit addresses this problem by much more accurately estimating
      the number of metadata blocks that will be required.  It will still
      somewhat over-estimate the number of blocks needed, since it must make
      a worst case estimate not knowing which physical blocks will be
      needed, but it is much more accurate than before.
      Signed-off-by: N"Theodore Ts'o" <tytso@mit.edu>
      9d0be502
    • T
      ext4: Fix accounting of reserved metadata blocks · ee5f4d9c
      Theodore Ts'o 提交于
      Commit 0637c6f4 had a typo which caused the reserved metadata blocks to
      not be released correctly.   Fix this.
      Signed-off-by: N"Theodore Ts'o" <tytso@mit.edu>
      ee5f4d9c
  21. 31 12月, 2009 1 次提交
    • T
      ext4: Patch up how we claim metadata blocks for quota purposes · 0637c6f4
      Theodore Ts'o 提交于
      As reported in Kernel Bugzilla #14936, commit d21cd8f1 triggered a BUG
      in the function ext4_da_update_reserve_space() found in
      fs/ext4/inode.c.  The root cause of this BUG() was caused by the fact
      that ext4_calc_metadata_amount() can severely over-estimate how many
      metadata blocks will be needed, especially when using direct
      block-mapped files.
      
      In addition, it can also badly *under* estimate how much space is
      needed, since ext4_calc_metadata_amount() assumes that the blocks are
      contiguous, and this is not always true.  If the application is
      writing blocks to a sparse file, the number of metadata blocks
      necessary can be severly underestimated by the functions
      ext4_da_reserve_space(), ext4_da_update_reserve_space() and
      ext4_da_release_space().  This was the cause of the dq_claim_space
      reports found on kerneloops.org.
      
      Unfortunately, doing this right means that we need to massively
      over-estimate the amount of free space needed.  So in some cases we
      may need to force the inode to be written to disk asynchronously in
      to avoid spurious quota failures.
      
      http://bugzilla.kernel.org/show_bug.cgi?id=14936Signed-off-by: N"Theodore Ts'o" <tytso@mit.edu>
      0637c6f4
  22. 26 12月, 2009 1 次提交
  23. 23 12月, 2009 4 次提交
    • E
      ext4: flush delalloc blocks when space is low · c8afb446
      Eric Sandeen 提交于
      Creating many small files in rapid succession on a small
      filesystem can lead to spurious ENOSPC; on a 104MB filesystem:
      
      for i in `seq 1 22500`; do
          echo -n > $SCRATCH_MNT/$i
          echo XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX > $SCRATCH_MNT/$i
      done
      
      leads to ENOSPC even though after a sync, 40% of the fs is free
      again.
      
      This is because we reserve worst-case metadata for delalloc writes,
      and when data is allocated that worst-case reservation is not
      usually needed.
      
      When freespace is low, kicking off an async writeback will start
      converting that worst-case space usage into something more realistic,
      almost always freeing up space to continue.
      
      This resolves the testcase for me, and survives all 4 generic
      ENOSPC tests in xfstests.
      
      We'll still need a hard synchronous sync to squeeze out the last bit,
      but this fixes things up to a large degree.
      Signed-off-by: NEric Sandeen <sandeen@redhat.com>
      Signed-off-by: N"Theodore Ts'o" <tytso@mit.edu>
      c8afb446
    • D
      ext4: fix sleep inside spinlock issue with quota and dealloc (#14739) · 39bc680a
      Dmitry Monakhov 提交于
      Unlock i_block_reservation_lock before vfs_dq_reserve_block().
      This patch fixes http://bugzilla.kernel.org/show_bug.cgi?id=14739
      
      CC: Theodore Ts'o <tytso@mit.edu>
      Signed-off-by: NDmitry Monakhov <dmonakhov@openvz.org>
      Signed-off-by: NJan Kara <jack@suse.cz>
      39bc680a
    • D
      ext4: Fix potential quota deadlock · d21cd8f1
      Dmitry Monakhov 提交于
      We have to delay vfs_dq_claim_space() until allocation context destruction.
      Currently we have following call-trace:
      ext4_mb_new_blocks()
        /* task is already holding ac->alloc_semp */
       ->ext4_mb_mark_diskspace_used
          ->vfs_dq_claim_space()  /*  acquire dqptr_sem here. Possible deadlock */
       ->ext4_mb_release_context() /* drop ac->alloc_semp here */
      
      Let's move quota claiming to ext4_da_update_reserve_space()
      
       =======================================================
       [ INFO: possible circular locking dependency detected ]
       2.6.32-rc7 #18
       -------------------------------------------------------
       write-truncate-/3465 is trying to acquire lock:
        (&s->s_dquot.dqptr_sem){++++..}, at: [<c025e73b>] dquot_claim_space+0x3b/0x1b0
      
       but task is already holding lock:
        (&meta_group_info[i]->alloc_sem){++++..}, at: [<c02ce962>] ext4_mb_load_buddy+0xb2/0x370
      
       which lock already depends on the new lock.
      
       the existing dependency chain (in reverse order) is:
      
       -> #3 (&meta_group_info[i]->alloc_sem){++++..}:
              [<c017d04b>] __lock_acquire+0xd7b/0x1260
              [<c017d5ea>] lock_acquire+0xba/0xd0
              [<c0527191>] down_read+0x51/0x90
              [<c02ce962>] ext4_mb_load_buddy+0xb2/0x370
              [<c02d0c1c>] ext4_mb_free_blocks+0x46c/0x870
              [<c029c9d3>] ext4_free_blocks+0x73/0x130
              [<c02c8cfc>] ext4_ext_truncate+0x76c/0x8d0
              [<c02a8087>] ext4_truncate+0x187/0x5e0
              [<c01e0f7b>] vmtruncate+0x6b/0x70
              [<c022ec02>] inode_setattr+0x62/0x190
              [<c02a2d7a>] ext4_setattr+0x25a/0x370
              [<c022ee81>] notify_change+0x151/0x340
              [<c021349d>] do_truncate+0x6d/0xa0
              [<c0221034>] may_open+0x1d4/0x200
              [<c022412b>] do_filp_open+0x1eb/0x910
              [<c021244d>] do_sys_open+0x6d/0x140
              [<c021258e>] sys_open+0x2e/0x40
              [<c0103100>] sysenter_do_call+0x12/0x32
      
       -> #2 (&ei->i_data_sem){++++..}:
              [<c017d04b>] __lock_acquire+0xd7b/0x1260
              [<c017d5ea>] lock_acquire+0xba/0xd0
              [<c0527191>] down_read+0x51/0x90
              [<c02a5787>] ext4_get_blocks+0x47/0x450
              [<c02a74c1>] ext4_getblk+0x61/0x1d0
              [<c02a7a7f>] ext4_bread+0x1f/0xa0
              [<c02bcddc>] ext4_quota_write+0x12c/0x310
              [<c0262d23>] qtree_write_dquot+0x93/0x120
              [<c0261708>] v2_write_dquot+0x28/0x30
              [<c025d3fb>] dquot_commit+0xab/0xf0
              [<c02be977>] ext4_write_dquot+0x77/0x90
              [<c02be9bf>] ext4_mark_dquot_dirty+0x2f/0x50
              [<c025e321>] dquot_alloc_inode+0x101/0x180
              [<c029fec2>] ext4_new_inode+0x602/0xf00
              [<c02ad789>] ext4_create+0x89/0x150
              [<c0221ff2>] vfs_create+0xa2/0xc0
              [<c02246e7>] do_filp_open+0x7a7/0x910
              [<c021244d>] do_sys_open+0x6d/0x140
              [<c021258e>] sys_open+0x2e/0x40
              [<c0103100>] sysenter_do_call+0x12/0x32
      
       -> #1 (&sb->s_type->i_mutex_key#7/4){+.+...}:
              [<c017d04b>] __lock_acquire+0xd7b/0x1260
              [<c017d5ea>] lock_acquire+0xba/0xd0
              [<c0526505>] mutex_lock_nested+0x65/0x2d0
              [<c0260c9d>] vfs_load_quota_inode+0x4bd/0x5a0
              [<c02610af>] vfs_quota_on_path+0x5f/0x70
              [<c02bc812>] ext4_quota_on+0x112/0x190
              [<c026345a>] sys_quotactl+0x44a/0x8a0
              [<c0103100>] sysenter_do_call+0x12/0x32
      
       -> #0 (&s->s_dquot.dqptr_sem){++++..}:
              [<c017d361>] __lock_acquire+0x1091/0x1260
              [<c017d5ea>] lock_acquire+0xba/0xd0
              [<c0527191>] down_read+0x51/0x90
              [<c025e73b>] dquot_claim_space+0x3b/0x1b0
              [<c02cb95f>] ext4_mb_mark_diskspace_used+0x36f/0x380
              [<c02d210a>] ext4_mb_new_blocks+0x34a/0x530
              [<c02c83fb>] ext4_ext_get_blocks+0x122b/0x13c0
              [<c02a5966>] ext4_get_blocks+0x226/0x450
              [<c02a5ff3>] mpage_da_map_blocks+0xc3/0xaa0
              [<c02a6ed6>] ext4_da_writepages+0x506/0x790
              [<c01de272>] do_writepages+0x22/0x50
              [<c01d766d>] __filemap_fdatawrite_range+0x6d/0x80
              [<c01d7b9b>] filemap_flush+0x2b/0x30
              [<c02a40ac>] ext4_alloc_da_blocks+0x5c/0x60
              [<c029e595>] ext4_release_file+0x75/0xb0
              [<c0216b59>] __fput+0xf9/0x210
              [<c0216c97>] fput+0x27/0x30
              [<c02122dc>] filp_close+0x4c/0x80
              [<c014510e>] put_files_struct+0x6e/0xd0
              [<c01451b7>] exit_files+0x47/0x60
              [<c0146a24>] do_exit+0x144/0x710
              [<c0147028>] do_group_exit+0x38/0xa0
              [<c0159abc>] get_signal_to_deliver+0x2ac/0x410
              [<c0102849>] do_notify_resume+0xb9/0x890
              [<c01032d2>] work_notifysig+0x13/0x21
      
       other info that might help us debug this:
      
       3 locks held by write-truncate-/3465:
        #0:  (jbd2_handle){+.+...}, at: [<c02e1f8f>] start_this_handle+0x38f/0x5c0
        #1:  (&ei->i_data_sem){++++..}, at: [<c02a57f6>] ext4_get_blocks+0xb6/0x450
        #2:  (&meta_group_info[i]->alloc_sem){++++..}, at: [<c02ce962>] ext4_mb_load_buddy+0xb2/0x370
      
       stack backtrace:
       Pid: 3465, comm: write-truncate- Not tainted 2.6.32-rc7 #18
       Call Trace:
        [<c0524cb3>] ? printk+0x1d/0x22
        [<c017ac9a>] print_circular_bug+0xca/0xd0
        [<c017d361>] __lock_acquire+0x1091/0x1260
        [<c016bca2>] ? sched_clock_local+0xd2/0x170
        [<c0178fd0>] ? trace_hardirqs_off_caller+0x20/0xd0
        [<c017d5ea>] lock_acquire+0xba/0xd0
        [<c025e73b>] ? dquot_claim_space+0x3b/0x1b0
        [<c0527191>] down_read+0x51/0x90
        [<c025e73b>] ? dquot_claim_space+0x3b/0x1b0
        [<c025e73b>] dquot_claim_space+0x3b/0x1b0
        [<c02cb95f>] ext4_mb_mark_diskspace_used+0x36f/0x380
        [<c02d210a>] ext4_mb_new_blocks+0x34a/0x530
        [<c02c601d>] ? ext4_ext_find_extent+0x25d/0x280
        [<c02c83fb>] ext4_ext_get_blocks+0x122b/0x13c0
        [<c016bca2>] ? sched_clock_local+0xd2/0x170
        [<c016be60>] ? sched_clock_cpu+0x120/0x160
        [<c016beef>] ? cpu_clock+0x4f/0x60
        [<c0178fd0>] ? trace_hardirqs_off_caller+0x20/0xd0
        [<c052712c>] ? down_write+0x8c/0xa0
        [<c02a5966>] ext4_get_blocks+0x226/0x450
        [<c016be60>] ? sched_clock_cpu+0x120/0x160
        [<c016beef>] ? cpu_clock+0x4f/0x60
        [<c017908b>] ? trace_hardirqs_off+0xb/0x10
        [<c02a5ff3>] mpage_da_map_blocks+0xc3/0xaa0
        [<c01d69cc>] ? find_get_pages_tag+0x16c/0x180
        [<c01d6860>] ? find_get_pages_tag+0x0/0x180
        [<c02a73bd>] ? __mpage_da_writepage+0x16d/0x1a0
        [<c01dfc4e>] ? pagevec_lookup_tag+0x2e/0x40
        [<c01ddf1b>] ? write_cache_pages+0xdb/0x3d0
        [<c02a7250>] ? __mpage_da_writepage+0x0/0x1a0
        [<c02a6ed6>] ext4_da_writepages+0x506/0x790
        [<c016beef>] ? cpu_clock+0x4f/0x60
        [<c016bca2>] ? sched_clock_local+0xd2/0x170
        [<c016be60>] ? sched_clock_cpu+0x120/0x160
        [<c016be60>] ? sched_clock_cpu+0x120/0x160
        [<c02a69d0>] ? ext4_da_writepages+0x0/0x790
        [<c01de272>] do_writepages+0x22/0x50
        [<c01d766d>] __filemap_fdatawrite_range+0x6d/0x80
        [<c01d7b9b>] filemap_flush+0x2b/0x30
        [<c02a40ac>] ext4_alloc_da_blocks+0x5c/0x60
        [<c029e595>] ext4_release_file+0x75/0xb0
        [<c0216b59>] __fput+0xf9/0x210
        [<c0216c97>] fput+0x27/0x30
        [<c02122dc>] filp_close+0x4c/0x80
        [<c014510e>] put_files_struct+0x6e/0xd0
        [<c01451b7>] exit_files+0x47/0x60
        [<c0146a24>] do_exit+0x144/0x710
        [<c017b163>] ? lock_release_holdtime+0x33/0x210
        [<c0528137>] ? _spin_unlock_irq+0x27/0x30
        [<c0147028>] do_group_exit+0x38/0xa0
        [<c017babb>] ? trace_hardirqs_on+0xb/0x10
        [<c0159abc>] get_signal_to_deliver+0x2ac/0x410
        [<c0102849>] do_notify_resume+0xb9/0x890
        [<c0178fd0>] ? trace_hardirqs_off_caller+0x20/0xd0
        [<c017b163>] ? lock_release_holdtime+0x33/0x210
        [<c0165b50>] ? autoremove_wake_function+0x0/0x50
        [<c017ba54>] ? trace_hardirqs_on_caller+0x134/0x190
        [<c017babb>] ? trace_hardirqs_on+0xb/0x10
        [<c0300ba4>] ? security_file_permission+0x14/0x20
        [<c0215761>] ? vfs_write+0x131/0x190
        [<c0214f50>] ? do_sync_write+0x0/0x120
        [<c0103115>] ? sysenter_do_call+0x27/0x32
        [<c01032d2>] work_notifysig+0x13/0x21
      
      CC: Theodore Ts'o <tytso@mit.edu>
      Signed-off-by: NDmitry Monakhov <dmonakhov@openvz.org>
      Signed-off-by: NJan Kara <jack@suse.cz>
      d21cd8f1
    • D
      ext4: Convert to generic reserved quota's space management. · a9e7f447
      Dmitry Monakhov 提交于
      This patch also fixes write vs chown race condition.
      Acked-by: N"Theodore Ts'o" <tytso@mit.edu>
      Signed-off-by: NDmitry Monakhov <dmonakhov@openvz.org>
      Signed-off-by: NJan Kara <jack@suse.cz>
      a9e7f447
  24. 01 1月, 2010 1 次提交