1. 16 4月, 2015 4 次提交
  2. 12 4月, 2015 22 次提交
  3. 11 4月, 2015 5 次提交
  4. 08 4月, 2015 1 次提交
  5. 03 4月, 2015 8 次提交
    • L
      ext4: make fsync to sync parent dir in no-journal for real this time · e12fb972
      Lukas Czerner 提交于
      Previously commit 14ece102 added a
      support for for syncing parent directory of newly created inodes to
      make sure that the inode is not lost after a power failure in
      no-journal mode.
      
      However this does not work in majority of cases, namely:
       - if the directory has inline data
       - if the directory is already indexed
       - if the directory already has at least one block and:
      	- the new entry fits into it
      	- or we've successfully converted it to indexed
      
      So in those cases we might lose the inode entirely even after fsync in
      the no-journal mode. This also includes ext2 default mode obviously.
      
      I've noticed this while running xfstest generic/321 and even though the
      test should fail (we need to run fsck after a crash in no-journal mode)
      I could not find a newly created entries even when if it was fsynced
      before.
      
      Fix this by adjusting the ext4_add_entry() successful exit paths to set
      the inode EXT4_STATE_NEWENTRY so that fsync has the chance to fsync the
      parent directory as well.
      Signed-off-by: NLukas Czerner <lczerner@redhat.com>
      Signed-off-by: NTheodore Ts'o <tytso@mit.edu>
      Reviewed-by: NJan Kara <jack@suse.cz>
      Cc: Frank Mayhar <fmayhar@google.com>
      Cc: stable@vger.kernel.org
      e12fb972
    • E
      ext4: don't release reserved space for previously allocated cluster · 9d21c9fa
      Eric Whitney 提交于
      When xfstests' auto group is run on a bigalloc filesystem with a
      4.0-rc3 kernel, e2fsck failures and kernel warnings occur for some
      tests. e2fsck reports incorrect iblocks values, and the warnings
      indicate that the space reserved for delayed allocation is being
      overdrawn at allocation time.
      
      Some of these errors occur because the reserved space is incorrectly
      decreased by one cluster when ext4_ext_map_blocks satisfies an
      allocation request by mapping an unused portion of a previously
      allocated cluster.  Because a cluster's worth of reserved space was
      already released when it was first allocated, it should not be released
      again.
      
      This patch appears to correct the e2fsck failure reported for
      generic/232 and the kernel warnings produced by ext4/001, generic/009,
      and generic/033.  Failures and warnings for some other tests remain to
      be addressed.
      Signed-off-by: NEric Whitney <enwlinux@gmail.com>
      Signed-off-by: NTheodore Ts'o <tytso@mit.edu>
      9d21c9fa
    • E
      ext4: fix loss of delalloc extent info in ext4_zero_range() · 94426f4b
      Eric Whitney 提交于
      In ext4_zero_range(), removing a file's entire block range from the
      extent status tree removes all records of that file's delalloc extents.
      The delalloc accounting code uses this information, and its loss can
      then lead to accounting errors and kernel warnings at writeback time and
      subsequent file system damage.  This is most noticeable on bigalloc
      file systems where code in ext4_ext_map_blocks() handles cases where
      delalloc extents share clusters with a newly allocated extent.
      
      Because we're not deleting a block range and are correctly updating the
      status of its associated extent, there is no need to remove anything
      from the extent status tree.
      
      When this patch is combined with an unrelated bug fix for
      ext4_zero_range(), kernel warnings and e2fsck errors reported during
      xfstests runs on bigalloc filesystems are greatly reduced without
      introducing regressions on other xfstests-bld test scenarios.
      Signed-off-by: NEric Whitney <enwlinux@gmail.com>
      Signed-off-by: NTheodore Ts'o <tytso@mit.edu>
      94426f4b
    • L
      ext4: allocate entire range in zero range · 0f2af21a
      Lukas Czerner 提交于
      Currently there is a bug in zero range code which causes zero range
      calls to only allocate block aligned portion of the range, while
      ignoring the rest in some cases.
      
      In some cases, namely if the end of the range is past i_size, we do
      attempt to preallocate the last nonaligned block. However this might
      cause kernel to BUG() in some carefully designed zero range requests
      on setups where page size > block size.
      
      Fix this problem by first preallocating the entire range, including
      the nonaligned edges and converting the written extents to unwritten
      in the next step. This approach will also give us the advantage of
      having the range to be as linearly contiguous as possible.
      Signed-off-by: NLukas Czerner <lczerner@redhat.com>
      Signed-off-by: NTheodore Ts'o <tytso@mit.edu>
      0f2af21a
    • M
      ext4: remove unnecessary lock/unlock of i_block_reservation_lock · 5a4f3145
      Maurizio Lombardi 提交于
      This is a leftover of commit 71d4f7d0Signed-off-by: NMaurizio Lombardi <mlombard@redhat.com>
      Signed-off-by: NTheodore Ts'o <tytso@mit.edu>
      Reviewed-by: NLukas Czerner <lczerner@redhat.com>
      5a4f3145
    • C
      ext4: remove block_device_ejected · 08439fec
      Christoph Hellwig 提交于
      bdi->dev now never goes away, so this function became useless.
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NTheodore Ts'o <tytso@mit.edu>
      08439fec
    • W
      ext4: remove useless condition in if statement. · 5f80f62a
      Wei Yuan 提交于
      In this if statement, the previous condition is useless, the later one
      has covered it.
      Signed-off-by: NWeiyuan <weiyuan.wei@huawei.com>
      Signed-off-by: NTheodore Ts'o <tytso@mit.edu>
      Reviewed-by: NLukas Czerner <lczerner@redhat.com>
      5f80f62a
    • S
      ext4: remove unused header files · 72b8e0f9
      Sheng Yong 提交于
      Remove unused header files and header files which are included in
      ext4.h.
      Signed-off-by: NSheng Yong <shengyong1@huawei.com>
      Signed-off-by: NTheodore Ts'o <tytso@mit.edu>
      72b8e0f9