26 Apr, 2010

1 commit


04 Apr, 2010

2 commits

  • 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: Curt Wohlgemuth
    Signed-off-by: "Theodore Ts'o"

    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: Curt Wohlgemuth
    Signed-off-by: "Theodore Ts'o"

    Curt Wohlgemuth
     

30 Mar, 2010

1 commit

  • …it 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: Tejun Heo <tj@kernel.org>
    Guess-its-ok-by: Christoph Lameter <cl@linux-foundation.org>
    Cc: Ingo Molnar <mingo@redhat.com>
    Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>

    Tejun Heo
     

15 Mar, 2010

1 commit


06 Mar, 2010

3 commits

  • * 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs-2.6: (33 commits)
    quota: stop using QUOTA_OK / NO_QUOTA
    dquot: cleanup dquot initialize routine
    dquot: move dquot initialization responsibility into the filesystem
    dquot: cleanup dquot drop routine
    dquot: move dquot drop responsibility into the filesystem
    dquot: cleanup dquot transfer routine
    dquot: move dquot transfer responsibility into the filesystem
    dquot: cleanup inode allocation / freeing routines
    dquot: cleanup space allocation / freeing routines
    ext3: add writepage sanity checks
    ext3: Truncate allocated blocks if direct IO write fails to update i_size
    quota: Properly invalidate caches even for filesystems with blocksize < pagesize
    quota: generalize quota transfer interface
    quota: sb_quota state flags cleanup
    jbd: Delay discarding buffers in journal_unmap_buffer
    ext3: quota_write cross block boundary behaviour
    quota: drop permission checks from xfs_fs_set_xstate/xfs_fs_set_xquota
    quota: split out compat_sys_quotactl support from quota.c
    quota: split out netlink notification support from quota.c
    quota: remove invalid optimization from quota_sync_all
    ...

    Fixed trivial conflicts in fs/namei.c and fs/ufs/inode.c

    Linus Torvalds
     
  • * 'write_inode2' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6:
    pass writeback_control to ->write_inode
    make sure data is on disk before calling ->write_inode

    Linus Torvalds
     
  • This gives the filesystem more information about the writeback that
    is happening. Trond requested this for the NFS unstable write handling,
    and other filesystems might benefit from this too by beeing able to
    distinguish between the different callers in more detail.

    Signed-off-by: Christoph Hellwig
    Signed-off-by: Al Viro

    Christoph Hellwig
     

05 Mar, 2010

5 commits

  • 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: Christoph Hellwig
    Signed-off-by: Jan Kara

    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: Christoph Hellwig
    Signed-off-by: Jan Kara

    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: Christoph Hellwig
    Signed-off-by: Jan Kara

    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: Christoph Hellwig
    Signed-off-by: Jan Kara

    Christoph Hellwig
     
  • 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: Jiaying Zhang
    Signed-off-by: "Theodore Ts'o"

    Jiaying Zhang
     

04 Mar, 2010

1 commit

  • We forget to release page references we acquire in
    ext4_da_block_invalidatepages. Luckily, this function gets called only if we
    are not able to allocate blocks for delay-allocated data so that function
    should better never be called.

    Also cleanup handling of index variable.

    Reported-by: Wu Fengguang
    Signed-off-by: Jan Kara
    Signed-off-by: "Theodore Ts'o"

    Jan Kara
     

03 Mar, 2010

3 commits


02 Mar, 2010

1 commit


24 Feb, 2010

1 commit

  • fallocate() may potentially instantiate blocks past EOF, depending
    on the flags used when it is called.

    e2fsck currently has a test for blocks past i_size, and it
    sometimes trips up - noticeably on xfstests 013 which runs fsstress.

    This patch from Jiayang does fix it up - it (along with
    e2fsprogs updates and other patches recently from Aneesh) has
    survived many fsstress runs in a row.

    Signed-off-by: Eric Sandeen
    Signed-off-by: Jiaying Zhang
    Signed-off-by: "Theodore Ts'o"

    Jiaying Zhang
     

17 Feb, 2010

1 commit

  • 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: Curt Wohlgemuth
    Signed-off-by: "Theodore Ts'o"

    Curt Wohlgemuth
     

16 Feb, 2010

1 commit


05 Feb, 2010

1 commit

  • The "offset" member in ext4_io_end holds bytes, not blocks, so
    ext4_lblk_t is wrong - and too small (u32).

    This caused the async i/o writes to sparse files beyond 4GB to fail
    when they wrapped around to 0.

    Also fix up the type of arguments to ext4_convert_unwritten_extents(),
    it gets ssize_t from ext4_end_aio_dio_nolock() and
    ext4_ext_direct_IO().

    Reported-by: Giel de Nijs
    Signed-off-by: Eric Sandeen

    Eric Sandeen
     

25 Jan, 2010

2 commits

  • 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
    Signed-off-by: "Theodore Ts'o"

    Theodore Ts'o
     
  • When we fallocate a region of the file which we had recently written,
    and which is still in the page cache marked as delayed allocated blocks
    we need to make sure we don't do the quota update on writepage path.
    This is because the needed quota updated would have already be done
    by fallocate.

    Signed-off-by: Aneesh Kumar K.V

    Aneesh Kumar K.V
     

23 Jan, 2010

2 commits

  • We need to release the journal before we do a write_inode. Otherwise
    we could deadlock.

    Signed-off-by: Aneesh Kumar K.V

    Aneesh Kumar K.V
     
  • Add checks to ext4_free_branches() to make sure a block number found
    in an indirect block are valid before trying to free it. If a bad
    block number is found, stop freeing the indirect block immediately,
    since the file system is corrupt and we will need to run fsck anyway.
    This also avoids spamming the logs, and specifically avoids
    driver-level "attempt to access beyond end of device" errors obscure
    what is really going on.

    If you get *really*, *really*, *really* unlucky, without this patch, a
    supposed indirect block containing garbage might contain a reference
    to a primary block group descriptor, in which case
    ext4_free_branches() could end up zero'ing out a block group
    descriptor block, and if then one of the block bitmaps for a block
    group described by that bg descriptor block is not in memory, and is
    read in by ext4_read_block_bitmap(). This function calls
    ext4_valid_block_bitmap(), which assumes that bg_inode_table() was
    validated at mount time and hasn't been modified since. Since this
    assumption is no longer valid, it's possible for the value
    (ext4_inode_table(sb, desc) - group_first_block) to go negative, which
    will cause ext4_find_next_zero_bit() to trigger a kernel GPF.

    Addresses-Google-Bug: #2220436

    Signed-off-by: "Theodore Ts'o"

    Theodore Ts'o
     

15 Jan, 2010

1 commit


01 Jan, 2010

3 commits

  • 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 0637c6f, 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: "Theodore Ts'o"

    Theodore Ts'o
     
  • Commit 0637c6f had a typo which caused the reserved metadata blocks to
    not be released correctly. Fix this.

    Signed-off-by: "Theodore Ts'o"

    Theodore Ts'o
     
  • Add tracepoints for ext4_da_reserve_space(),
    ext4_da_update_reserve_space(), and ext4_da_release_space().

    Signed-off-by: "Theodore Ts'o"

    Theodore Ts'o
     

31 Dec, 2009

1 commit

  • As reported in Kernel Bugzilla #14936, commit d21cd8f 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=14936

    Signed-off-by: "Theodore Ts'o"

    Theodore Ts'o
     

26 Dec, 2009

1 commit

  • When ext4_da_writepages increases the nr_to_write in writeback_control
    then it must always re-base the return value. Originally there was a
    (misguided) attempt prevent wbc.nr_to_write from going negative. In
    fact, it's necessary to allow nr_to_write to be negative so that
    wb_writeback() can correctly calculate how many pages were actually
    written.

    Signed-off-by: Richard Kennedy
    Signed-off-by: "Theodore Ts'o"

    Richard Kennedy
     

23 Dec, 2009

4 commits

  • 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: Eric Sandeen
    Signed-off-by: "Theodore Ts'o"

    Eric Sandeen
     
  • 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
    Signed-off-by: Dmitry Monakhov
    Signed-off-by: Jan Kara

    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: [] dquot_claim_space+0x3b/0x1b0

    but task is already holding lock:
    (&meta_group_info[i]->alloc_sem){++++..}, at: [] 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){++++..}:
    [] __lock_acquire+0xd7b/0x1260
    [] lock_acquire+0xba/0xd0
    [] down_read+0x51/0x90
    [] ext4_mb_load_buddy+0xb2/0x370
    [] ext4_mb_free_blocks+0x46c/0x870
    [] ext4_free_blocks+0x73/0x130
    [] ext4_ext_truncate+0x76c/0x8d0
    [] ext4_truncate+0x187/0x5e0
    [] vmtruncate+0x6b/0x70
    [] inode_setattr+0x62/0x190
    [] ext4_setattr+0x25a/0x370
    [] notify_change+0x151/0x340
    [] do_truncate+0x6d/0xa0
    [] may_open+0x1d4/0x200
    [] do_filp_open+0x1eb/0x910
    [] do_sys_open+0x6d/0x140
    [] sys_open+0x2e/0x40
    [] sysenter_do_call+0x12/0x32

    -> #2 (&ei->i_data_sem){++++..}:
    [] __lock_acquire+0xd7b/0x1260
    [] lock_acquire+0xba/0xd0
    [] down_read+0x51/0x90
    [] ext4_get_blocks+0x47/0x450
    [] ext4_getblk+0x61/0x1d0
    [] ext4_bread+0x1f/0xa0
    [] ext4_quota_write+0x12c/0x310
    [] qtree_write_dquot+0x93/0x120
    [] v2_write_dquot+0x28/0x30
    [] dquot_commit+0xab/0xf0
    [] ext4_write_dquot+0x77/0x90
    [] ext4_mark_dquot_dirty+0x2f/0x50
    [] dquot_alloc_inode+0x101/0x180
    [] ext4_new_inode+0x602/0xf00
    [] ext4_create+0x89/0x150
    [] vfs_create+0xa2/0xc0
    [] do_filp_open+0x7a7/0x910
    [] do_sys_open+0x6d/0x140
    [] sys_open+0x2e/0x40
    [] sysenter_do_call+0x12/0x32

    -> #1 (&sb->s_type->i_mutex_key#7/4){+.+...}:
    [] __lock_acquire+0xd7b/0x1260
    [] lock_acquire+0xba/0xd0
    [] mutex_lock_nested+0x65/0x2d0
    [] vfs_load_quota_inode+0x4bd/0x5a0
    [] vfs_quota_on_path+0x5f/0x70
    [] ext4_quota_on+0x112/0x190
    [] sys_quotactl+0x44a/0x8a0
    [] sysenter_do_call+0x12/0x32

    -> #0 (&s->s_dquot.dqptr_sem){++++..}:
    [] __lock_acquire+0x1091/0x1260
    [] lock_acquire+0xba/0xd0
    [] down_read+0x51/0x90
    [] dquot_claim_space+0x3b/0x1b0
    [] ext4_mb_mark_diskspace_used+0x36f/0x380
    [] ext4_mb_new_blocks+0x34a/0x530
    [] ext4_ext_get_blocks+0x122b/0x13c0
    [] ext4_get_blocks+0x226/0x450
    [] mpage_da_map_blocks+0xc3/0xaa0
    [] ext4_da_writepages+0x506/0x790
    [] do_writepages+0x22/0x50
    [] __filemap_fdatawrite_range+0x6d/0x80
    [] filemap_flush+0x2b/0x30
    [] ext4_alloc_da_blocks+0x5c/0x60
    [] ext4_release_file+0x75/0xb0
    [] __fput+0xf9/0x210
    [] fput+0x27/0x30
    [] filp_close+0x4c/0x80
    [] put_files_struct+0x6e/0xd0
    [] exit_files+0x47/0x60
    [] do_exit+0x144/0x710
    [] do_group_exit+0x38/0xa0
    [] get_signal_to_deliver+0x2ac/0x410
    [] do_notify_resume+0xb9/0x890
    [] work_notifysig+0x13/0x21

    other info that might help us debug this:

    3 locks held by write-truncate-/3465:
    #0: (jbd2_handle){+.+...}, at: [] start_this_handle+0x38f/0x5c0
    #1: (&ei->i_data_sem){++++..}, at: [] ext4_get_blocks+0xb6/0x450
    #2: (&meta_group_info[i]->alloc_sem){++++..}, at: [] ext4_mb_load_buddy+0xb2/0x370

    stack backtrace:
    Pid: 3465, comm: write-truncate- Not tainted 2.6.32-rc7 #18
    Call Trace:
    [] ? printk+0x1d/0x22
    [] print_circular_bug+0xca/0xd0
    [] __lock_acquire+0x1091/0x1260
    [] ? sched_clock_local+0xd2/0x170
    [] ? trace_hardirqs_off_caller+0x20/0xd0
    [] lock_acquire+0xba/0xd0
    [] ? dquot_claim_space+0x3b/0x1b0
    [] down_read+0x51/0x90
    [] ? dquot_claim_space+0x3b/0x1b0
    [] dquot_claim_space+0x3b/0x1b0
    [] ext4_mb_mark_diskspace_used+0x36f/0x380
    [] ext4_mb_new_blocks+0x34a/0x530
    [] ? ext4_ext_find_extent+0x25d/0x280
    [] ext4_ext_get_blocks+0x122b/0x13c0
    [] ? sched_clock_local+0xd2/0x170
    [] ? sched_clock_cpu+0x120/0x160
    [] ? cpu_clock+0x4f/0x60
    [] ? trace_hardirqs_off_caller+0x20/0xd0
    [] ? down_write+0x8c/0xa0
    [] ext4_get_blocks+0x226/0x450
    [] ? sched_clock_cpu+0x120/0x160
    [] ? cpu_clock+0x4f/0x60
    [] ? trace_hardirqs_off+0xb/0x10
    [] mpage_da_map_blocks+0xc3/0xaa0
    [] ? find_get_pages_tag+0x16c/0x180
    [] ? find_get_pages_tag+0x0/0x180
    [] ? __mpage_da_writepage+0x16d/0x1a0
    [] ? pagevec_lookup_tag+0x2e/0x40
    [] ? write_cache_pages+0xdb/0x3d0
    [] ? __mpage_da_writepage+0x0/0x1a0
    [] ext4_da_writepages+0x506/0x790
    [] ? cpu_clock+0x4f/0x60
    [] ? sched_clock_local+0xd2/0x170
    [] ? sched_clock_cpu+0x120/0x160
    [] ? sched_clock_cpu+0x120/0x160
    [] ? ext4_da_writepages+0x0/0x790
    [] do_writepages+0x22/0x50
    [] __filemap_fdatawrite_range+0x6d/0x80
    [] filemap_flush+0x2b/0x30
    [] ext4_alloc_da_blocks+0x5c/0x60
    [] ext4_release_file+0x75/0xb0
    [] __fput+0xf9/0x210
    [] fput+0x27/0x30
    [] filp_close+0x4c/0x80
    [] put_files_struct+0x6e/0xd0
    [] exit_files+0x47/0x60
    [] do_exit+0x144/0x710
    [] ? lock_release_holdtime+0x33/0x210
    [] ? _spin_unlock_irq+0x27/0x30
    [] do_group_exit+0x38/0xa0
    [] ? trace_hardirqs_on+0xb/0x10
    [] get_signal_to_deliver+0x2ac/0x410
    [] do_notify_resume+0xb9/0x890
    [] ? trace_hardirqs_off_caller+0x20/0xd0
    [] ? lock_release_holdtime+0x33/0x210
    [] ? autoremove_wake_function+0x0/0x50
    [] ? trace_hardirqs_on_caller+0x134/0x190
    [] ? trace_hardirqs_on+0xb/0x10
    [] ? security_file_permission+0x14/0x20
    [] ? vfs_write+0x131/0x190
    [] ? do_sync_write+0x0/0x120
    [] ? sysenter_do_call+0x27/0x32
    [] work_notifysig+0x13/0x21

    CC: Theodore Ts'o
    Signed-off-by: Dmitry Monakhov
    Signed-off-by: Jan Kara

    Dmitry Monakhov
     
  • This patch also fixes write vs chown race condition.

    Acked-by: "Theodore Ts'o"
    Signed-off-by: Dmitry Monakhov
    Signed-off-by: Jan Kara

    Dmitry Monakhov
     

11 Dec, 2009

1 commit

  • * 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4: (47 commits)
    ext4: Fix potential fiemap deadlock (mmap_sem vs. i_data_sem)
    ext4: Do not override ext2 or ext3 if built they are built as modules
    jbd2: Export jbd2_log_start_commit to fix ext4 build
    ext4: Fix insufficient checks in EXT4_IOC_MOVE_EXT
    ext4: Wait for proper transaction commit on fsync
    ext4: fix incorrect block reservation on quota transfer.
    ext4: quota macros cleanup
    ext4: ext4_get_reserved_space() must return bytes instead of blocks
    ext4: remove blocks from inode prealloc list on failure
    ext4: wait for log to commit when umounting
    ext4: Avoid data / filesystem corruption when write fails to copy data
    ext4: Use ext4 file system driver for ext2/ext3 file system mounts
    ext4: Return the PTR_ERR of the correct pointer in setup_new_group_blocks()
    jbd2: Add ENOMEM checking in and for jbd2_journal_write_metadata_buffer()
    ext4: remove unused parameter wbc from __ext4_journalled_writepage()
    ext4: remove encountered_congestion trace
    ext4: move_extent_per_page() cleanup
    ext4: initialize moved_len before calling ext4_move_extents()
    ext4: Fix double-free of blocks with EXT4_IOC_MOVE_EXT
    ext4: use ext4_data_block_valid() in ext4_free_blocks()
    ...

    Linus Torvalds
     

09 Dec, 2009

2 commits

  • We cannot rely on buffer dirty bits during fsync because pdflush can come
    before fsync is called and clear dirty bits without forcing a transaction
    commit. What we do is that we track which transaction has last changed
    the inode and which transaction last changed allocation and force it to
    disk on fsync.

    Signed-off-by: Jan Kara
    Signed-off-by: "Theodore Ts'o"

    Jan Kara
     
  • Inside ->setattr() call both ATTR_UID and ATTR_GID may be valid
    This means that we may end-up with transferring all quotas. Add
    we have to reserve QUOTA_DEL_BLOCKS for all quotas, as we do in
    case of QUOTA_INIT_BLOCKS.

    Signed-off-by: Dmitry Monakhov
    Reviewed-by: Mingming Cao
    Signed-off-by: "Theodore Ts'o"

    Dmitry Monakhov
     

08 Dec, 2009

1 commit