11 Dec, 2012

1 commit


30 Nov, 2012

1 commit

  • Commit fa77dcfafeaa introduces block bitmap checksum calculation into
    ext4_new_inode() in the case that block group was uninitialized.
    However we brelse() the bitmap buffer before we attempt to checksum it
    so we have no guarantee that the buffer is still there.

    Fix this by releasing the buffer after the possible checksum
    computation.

    Signed-off-by: Lukas Czerner
    Signed-off-by: "Theodore Ts'o"
    Acked-by: Darrick J. Wong
    Cc: stable@vger.kernel.org

    Theodore Ts'o
     

29 Oct, 2012

1 commit

  • commit 119c0d4460b001e44b41dcf73dc6ee794b98bd31 changed
    ext4_new_inode() such that the inode bitmap was being modified
    outside a transaction, which could lead to corruption, and was
    discovered when journal_checksum found a bad checksum in the
    journal during log replay.

    Nix ran into this when using the journal_async_commit mount
    option, which enables journal checksumming. The ensuing
    journal replay failures due to the bad checksums led to
    filesystem corruption reported as the now infamous
    "Apparent serious progressive ext4 data corruption bug"

    [ Changed by tytso to only call ext4_journal_get_write_access() only
    when we're fairly certain that we're going to allocate the inode. ]

    I've tested this by mounting with journal_checksum and
    running fsstress then dropping power; I've also tested by
    hacking DM to create snapshots w/o first quiescing, which
    allows me to test journal replay repeatedly w/o actually
    power-cycling the box. Without the patch I hit a journal
    checksum error every time. With this fix it survives
    many iterations.

    Reported-by: Nix
    Signed-off-by: Eric Sandeen
    Signed-off-by: "Theodore Ts'o"
    Cc: stable@vger.kernel.org

    Eric Sandeen
     

22 Oct, 2012

1 commit

  • In mke2fs, we only checksum the whole bitmap block and it is right.
    While in the kernel, we use EXT4_BLOCKS_PER_GROUP to indicate the
    size of the checksumed bitmap which is wrong when we enable bigalloc.
    The right size should be EXT4_CLUSTERS_PER_GROUP and this patch fixes
    it.

    Also as every caller of ext4_block_bitmap_csum_set and
    ext4_block_bitmap_csum_verify pass in EXT4_BLOCKS_PER_GROUP(sb)/8,
    we'd better removes this parameter and sets it in the function itself.

    Signed-off-by: Tao Ma
    Signed-off-by: "Theodore Ts'o"
    Reviewed-by: Lukas Czerner
    Cc: stable@vger.kernel.org

    Tao Ma
     

24 Sep, 2012

1 commit


23 Jul, 2012

1 commit

  • Commit a0375156 properly notes that superblock doesn't need to be marked
    as dirty when only number of free inodes / blocks / number of directories
    changes since that is recomputed on each mount anyway. However that comment
    leaves some unnecessary markings as dirty in place. Remove these.

    Artem: tested using xfstests for both journalled and non-journalled ext4.

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

    Jan Kara
     

01 Jul, 2012

1 commit


02 Jun, 2012

1 commit

  • Pull Ext4 updates from Theodore Ts'o:
    "The major new feature added in this update is Darrick J Wong's
    metadata checksum feature, which adds crc32 checksums to ext4's
    metadata fields.

    There is also the usual set of cleanups and bug fixes."

    * tag 'ext4_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4: (44 commits)
    ext4: hole-punch use truncate_pagecache_range
    jbd2: use kmem_cache_zalloc wrapper instead of flag
    ext4: remove mb_groups before tearing down the buddy_cache
    ext4: add ext4_mb_unload_buddy in the error path
    ext4: don't trash state flags in EXT4_IOC_SETFLAGS
    ext4: let getattr report the right blocks in delalloc+bigalloc
    ext4: add missing save_error_info() to ext4_error()
    ext4: add debugging trigger for ext4_error()
    ext4: protect group inode free counting with group lock
    ext4: use consistent ssize_t type in ext4_file_write()
    ext4: fix format flag in ext4_ext_binsearch_idx()
    ext4: cleanup in ext4_discard_allocated_blocks()
    ext4: return ENOMEM when mounts fail due to lack of memory
    ext4: remove redundundant "(char *) bh->b_data" casts
    ext4: disallow hard-linked directory in ext4_lookup
    ext4: fix potential integer overflow in alloc_flex_gd()
    ext4: remove needs_recovery in ext4_mb_init()
    ext4: force ro mount if ext4_setup_super() fails
    ext4: fix potential NULL dereference in ext4_free_inodes_counts()
    ext4/jbd2: add metadata checksumming to the list of supported features
    ...

    Linus Torvalds
     

29 May, 2012

2 commits

  • Now when we set the group inode free count, we don't have a proper
    group lock so that multiple threads may decrease the inode free
    count at the same time. And e2fsck will complain something like:

    Free inodes count wrong for group #1 (1, counted=0).
    Fix? no

    Free inodes count wrong for group #2 (3, counted=0).
    Fix? no

    Directories count wrong for group #2 (780, counted=779).
    Fix? no

    Free inodes count wrong for group #3 (2272, counted=2273).
    Fix? no

    So this patch try to protect it with the ext4_lock_group.

    btw, it is found by xfstests test case 269 and the volume is
    mkfsed with the parameter
    "-O ^resize_inode,^uninit_bg,extent,meta_bg,flex_bg,ext_attr"
    and I have run it 100 times and the error in e2fsck doesn't
    show up again.

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

    Tao Ma
     
  • The ext4_get_group_desc() function returns NULL on error, and
    ext4_free_inodes_count() function dereferences it without checking.
    There is a check on the next line, but it's too late.

    Reviewed-by: Jan Kara
    Signed-off-by: Dan Carpenter
    Signed-off-by: "Theodore Ts'o"
    Cc: stable@kernel.org

    Dan Carpenter
     

16 May, 2012

1 commit


30 Apr, 2012

4 commits


20 Mar, 2012

2 commits


21 Feb, 2012

1 commit

  • In ext4_read_{inode,block}_bitmap() we were setting bitmap_uptodate()
    before submitting the buffer for read. The is bad, since we check
    bitmap_uptodate() without locking the buffer, and so if another
    process is racing with us, it's possible that they will think the
    bitmap is uptodate even though the read has not completed yet,
    resulting in inodes and blocks potentially getting allocated more than
    once if we get really unlucky.

    Addresses-Google-Bug: 2828254

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

    Theodore Ts'o
     

07 Feb, 2012

1 commit

  • The function ext4_claim_inode() is only called by one function,
    ext4_new_inode(), and by folding the functionality into
    ext4_new_inode(), we can remove almost 50 lines of code, and put all
    of the logic of allocating a new inode into a single place.

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

    Theodore Ts'o
     

11 Jan, 2012

1 commit


04 Jan, 2012

1 commit


29 Dec, 2011

2 commits

  • ext4_{set,clear}_bit() is defined as __test_and_{set,clear}_bit_le() for
    ext4. Only two ext4_{set,clear}_bit() calls check the return value. The
    rest of calls ignore the return value and they can be replaced with
    __{set,clear}_bit_le().

    This changes ext4_{set,clear}_bit() from __test_and_{set,clear}_bit_le()
    to __{set,clear}_bit_le() and introduces ext4_test_and_{set,clear}_bit()
    for the two places where old bit needs to be returned.

    This ext4_{set,clear}_bit() change is considered safe, because if someone
    uses these macros without noticing the change, new ext4_{set,clear}_bit
    don't have return value and causes compiler errors where the return value
    is used.

    This also removes unused ext4_find_first_zero_bit().

    Signed-off-by: Akinobu Mita
    Signed-off-by: Andrew Morton
    Signed-off-by: "Theodore Ts'o"

    Akinobu Mita
     
  • Signed-off-by: "Theodore Ts'o"

    Theodore Ts'o
     

19 Dec, 2011

1 commit

  • When insert_inode_locked() fails in ext4_new_inode() it most likely means inode
    bitmap got corrupted and we allocated again inode which is already in use. Also
    doing unlock_new_inode() during error recovery is wrong since the inode does
    not have I_NEW set. Fix the problem by jumping to fail: (instead of fail_drop:)
    which declares filesystem error and does not call unlock_new_inode().

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

    Jan Kara
     

03 Nov, 2011

1 commit

  • * 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/hch/vfs-queue:
    vfs: add d_prune dentry operation
    vfs: protect i_nlink
    filesystems: add set_nlink()
    filesystems: add missing nlink wrappers
    logfs: remove unnecessary nlink setting
    ocfs2: remove unnecessary nlink setting
    jfs: remove unnecessary nlink setting
    hypfs: remove unnecessary nlink setting
    vfs: ignore error on forced remount
    readlinkat: ensure we return ENOENT for the empty pathname for normal lookups
    vfs: fix dentry leak in simple_fill_super()

    Linus Torvalds
     

02 Nov, 2011

1 commit


01 Nov, 2011

1 commit


29 Oct, 2011

1 commit


18 Oct, 2011

1 commit

  • The function declarations in ext4.h are already marked extern, so it's
    not necessary to do so in the .c files.

    This quiets the sparse noise:

    warning: function 'ext4_flush_completed_IO' with external linkage has definition
    warning: function 'ext4_init_inode_table' with external linkage has definition

    Signed-off-by: H Hartley Sweeten
    Signed-off-by: "Theodore Ts'o"

    H Hartley Sweeten
     

09 Oct, 2011

1 commit

  • For a long time now orlov is the default block allocator in the
    ext4. It performs better than the old one and no one seems to claim
    otherwise so we can safely drop it and make oldalloc and orlov mount
    option deprecated.

    This is a part of the effort to reduce number of ext4 options hence the
    test matrix.

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

    Lukas Czerner
     

10 Sep, 2011

5 commits


01 Aug, 2011

1 commit


26 Mar, 2011

1 commit

  • * 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4: (43 commits)
    ext4: fix a BUG in mb_mark_used during trim.
    ext4: unused variables cleanup in fs/ext4/extents.c
    ext4: remove redundant set_buffer_mapped() in ext4_da_get_block_prep()
    ext4: add more tracepoints and use dev_t in the trace buffer
    ext4: don't kfree uninitialized s_group_info members
    ext4: add missing space in printk's in __ext4_grp_locked_error()
    ext4: add FITRIM to compat_ioctl.
    ext4: handle errors in ext4_clear_blocks()
    ext4: unify the ext4_handle_release_buffer() api
    ext4: handle errors in ext4_rename
    jbd2: add COW fields to struct jbd2_journal_handle
    jbd2: add the b_cow_tid field to journal_head struct
    ext4: Initialize fsync transaction ids in ext4_new_inode()
    ext4: Use single thread to perform DIO unwritten convertion
    ext4: optimize ext4_bio_write_page() when no extent conversion is needed
    ext4: skip orphan cleanup if fs has unknown ROCOMPAT features
    ext4: use the nblocks arg to ext4_truncate_restart_trans()
    ext4: fix missing iput of root inode for some mount error paths
    ext4: make FIEMAP and delayed allocation play well together
    ext4: suppress verbose debugging information if malloc-debug is off
    ...

    Fi up conflicts in fs/ext4/super.c due to workqueue changes

    Linus Torvalds
     

22 Mar, 2011

1 commit

  • - Add more ext4 tracepoints.
    - Change ext4 tracepoints to use dev_t field with MAJOR/MINOR macros
    so that we can save 4 bytes in the ring buffer on some platforms.
    - Add sync_mode to ext4_da_writepages, ext4_da_write_pages, and
    ext4_da_writepages_result tracepoints. Also remove for_reclaim
    field from ext4_da_writepages since it is usually not very useful.

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

    Jiaying Zhang
     

17 Mar, 2011

1 commit

  • When allocating a new inode, we need to make sure i_sync_tid and
    i_datasync_tid are initialized. Otherwise, one or both of these two
    values could be left initialized to zero, which could potentially
    result in BUG_ON in jbd2_journal_commit_transaction.

    (This could happen by having journal->commit_request getting set to
    zero, which could wake up the kjournald process even though there is
    no running transaction, which then causes a BUG_ON via the
    J_ASSERT(j_ruinning_transaction != NULL) statement.

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

    Theodore Ts'o
     

08 Mar, 2011

1 commit