1. 05 4月, 2016 1 次提交
  2. 24 3月, 2016 1 次提交
  3. 16 3月, 2016 21 次提交
  4. 15 3月, 2016 5 次提交
  5. 14 3月, 2016 4 次提交
    • V
      ext4: clean up error handling in the MMP support · 03046886
      vikram.jadhav07 提交于
      There is memory leak as both caller function kmmpd() and callee
      read_mmp_block() not releasing bh_check  (i.e buffer_head).
      Given patch fixes this problem.
      
      [ Additional changes suggested by Andreas Dilger -- TYT ]
      Signed-off-by: NJadhav Vikram <vikramjadhavpucsd2007@gmail.com>
      Signed-off-by: NTheodore Ts'o <tytso@mit.edu>
      03046886
    • M
      jbd2: do not fail journal because of frozen_buffer allocation failure · 490c1b44
      Michal Hocko 提交于
      Journal transaction might fail prematurely because the frozen_buffer
      is allocated by GFP_NOFS request:
      [   72.440013] do_get_write_access: OOM for frozen_buffer
      [   72.440014] EXT4-fs: ext4_reserve_inode_write:4729: aborting transaction: Out of memory in __ext4_journal_get_write_access
      [   72.440015] EXT4-fs error (device sda1) in ext4_reserve_inode_write:4735: Out of memory
      (...snipped....)
      [   72.495559] do_get_write_access: OOM for frozen_buffer
      [   72.495560] EXT4-fs: ext4_reserve_inode_write:4729: aborting transaction: Out of memory in __ext4_journal_get_write_access
      [   72.496839] do_get_write_access: OOM for frozen_buffer
      [   72.496841] EXT4-fs: ext4_reserve_inode_write:4729: aborting transaction: Out of memory in __ext4_journal_get_write_access
      [   72.505766] Aborting journal on device sda1-8.
      [   72.505851] EXT4-fs (sda1): Remounting filesystem read-only
      
      This wasn't a problem until "mm: page_alloc: do not lock up GFP_NOFS
      allocations upon OOM" because small GPF_NOFS allocations never failed.
      This allocation seems essential for the journal and GFP_NOFS is too
      restrictive to the memory allocator so let's use __GFP_NOFAIL here to
      emulate the previous behavior.
      Signed-off-by: NMichal Hocko <mhocko@suse.com>
      Signed-off-by: NTheodore Ts'o <tytso@mit.edu>
      490c1b44
    • K
      ext4: use __GFP_NOFAIL in ext4_free_blocks() · adb7ef60
      Konstantin Khlebnikov 提交于
      This might be unexpected but pages allocated for sbi->s_buddy_cache are
      charged to current memory cgroup. So, GFP_NOFS allocation could fail if
      current task has been killed by OOM or if current memory cgroup has no
      free memory left. Block allocator cannot handle such failures here yet.
      Signed-off-by: NKonstantin Khlebnikov <khlebnikov@yandex-team.ru>
      Signed-off-by: NTheodore Ts'o <tytso@mit.edu>
      adb7ef60
    • A
      ext4: fix compile error while opening the macro DOUBLE_CHECK · a2821e34
      Aihua Zhang 提交于
      the error is:
          fs/ext4/mballoc.c:475:43: error: 'struct ext4_group_info' has
      no member named 'bb_bitmap'.
          so, the definition of macro DOUBLE_CHECK should before
      'struct ext4_group_info', I fixed it, and I moved the macro
      AGGRESSIVE_CHECK together, because I think they shoule be together.
      Signed-off-by: NAihua Zhang <zhangaihua1@huawei.com>
      Signed-off-by: NTheodore Ts'o <tytso@mit.edu>
      a2821e34
  6. 13 3月, 2016 2 次提交
    • A
      ext4: print ext4 mount option data_err=abort correctly · 7915a861
      Ales Novak 提交于
      If data_err=abort option is specified for an ext3/ext4 mount,
      /proc/mounts does show it as "(null)". This is caused by token2str()
      returning NULL for Opt_data_err_abort (due to its pattern containing
      '=').
      Signed-off-by: NAles Novak <alnovak@suse.cz>
      Signed-off-by: NTheodore Ts'o <tytso@mit.edu>
      7915a861
    • E
      ext4: fix NULL pointer dereference in ext4_mark_inode_dirty() · 5e1021f2
      Eryu Guan 提交于
      ext4_reserve_inode_write() in ext4_mark_inode_dirty() could fail on
      error (e.g. EIO) and iloc.bh can be NULL in this case. But the error is
      ignored in the following "if" condition and ext4_expand_extra_isize()
      might be called with NULL iloc.bh set, which triggers NULL pointer
      dereference.
      
      This is uncovered by commit 8b4953e1 ("ext4: reserve code points for
      the project quota feature"), which enlarges the ext4_inode size, and
      run the following script on new kernel but with old mke2fs:
      
        #/bin/bash
        mnt=/mnt/ext4
        devname=ext4-error
        dev=/dev/mapper/$devname
        fsimg=/home/fs.img
      
        trap cleanup 0 1 2 3 9 15
      
        cleanup()
        {
                umount $mnt >/dev/null 2>&1
                dmsetup remove $devname
                losetup -d $backend_dev
                rm -f $fsimg
                exit 0
        }
      
        rm -f $fsimg
        fallocate -l 1g $fsimg
        backend_dev=`losetup -f --show $fsimg`
        devsize=`blockdev --getsz $backend_dev`
      
        good_tab="0 $devsize linear $backend_dev 0"
        error_tab="0 $devsize error $backend_dev 0"
      
        dmsetup create $devname --table "$good_tab"
      
        mkfs -t ext4 $dev
        mount -t ext4 -o errors=continue,strictatime $dev $mnt
      
        dmsetup load $devname --table "$error_tab" && dmsetup resume $devname
        echo 3 > /proc/sys/vm/drop_caches
        ls -l $mnt
        exit 0
      
      [ Patch changed to simplify the function a tiny bit. -- Ted ]
      Signed-off-by: NEryu Guan <guaneryu@gmail.com>
      Signed-off-by: NTheodore Ts'o <tytso@mit.edu>
      5e1021f2
  7. 11 3月, 2016 1 次提交
  8. 10 3月, 2016 5 次提交
    • G
      ext4: drop unneeded BUFFER_TRACE in ext4_delete_inline_entry() · a8ed9b86
      Geliang Tang 提交于
      BUFFER_TRACE info "call ext4_handle_dirty_metadata" doesn't match the
      code, so drop it.
      Signed-off-by: NGeliang Tang <geliangtang@163.com>
      Signed-off-by: NTheodore Ts'o <tytso@mit.edu>
      a8ed9b86
    • A
      ext4: fix misspellings in comments. · b8a07463
      Adam Buchbinder 提交于
      Signed-off-by: NAdam Buchbinder <adam.buchbinder@gmail.com>
      Signed-off-by: NTheodore Ts'o <tytso@mit.edu>
      b8a07463
    • O
      jbd2: fix FS corruption possibility in jbd2_journal_destroy() on umount path · c0a2ad9b
      OGAWA Hirofumi 提交于
      On umount path, jbd2_journal_destroy() writes latest transaction ID
      (->j_tail_sequence) to be used at next mount.
      
      The bug is that ->j_tail_sequence is not holding latest transaction ID
      in some cases. So, at next mount, there is chance to conflict with
      remaining (not overwritten yet) transactions.
      
      	mount (id=10)
      	write transaction (id=11)
      	write transaction (id=12)
      	umount (id=10) <= the bug doesn't write latest ID
      
      	mount (id=10)
      	write transaction (id=11)
      	crash
      
      	mount
      	[recovery process]
      		transaction (id=11)
      		transaction (id=12) <= valid transaction ID, but old commit
                                             must not replay
      
      Like above, this bug become the cause of recovery failure, or FS
      corruption.
      
      So why ->j_tail_sequence doesn't point latest ID?
      
      Because if checkpoint transactions was reclaimed by memory pressure
      (i.e. bdev_try_to_free_page()), then ->j_tail_sequence is not updated.
      (And another case is, __jbd2_journal_clean_checkpoint_list() is called
      with empty transaction.)
      
      So in above cases, ->j_tail_sequence is not pointing latest
      transaction ID at umount path. Plus, REQ_FLUSH for checkpoint is not
      done too.
      
      So, to fix this problem with minimum changes, this patch updates
      ->j_tail_sequence, and issue REQ_FLUSH.  (With more complex changes,
      some optimizations would be possible to avoid unnecessary REQ_FLUSH
      for example though.)
      
      BTW,
      
      	journal->j_tail_sequence =
      		++journal->j_transaction_sequence;
      
      Increment of ->j_transaction_sequence seems to be unnecessary, but
      ext3 does this.
      Signed-off-by: NOGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
      Signed-off-by: NTheodore Ts'o <tytso@mit.edu>
      Cc: stable@vger.kernel.org
      c0a2ad9b
    • J
      ext4: more efficient SEEK_DATA implementation · 2d90c160
      Jan Kara 提交于
      Using SEEK_DATA in a huge sparse file can easily lead to sotflockups as
      ext4_seek_data() iterates hole block-by-block. Fix the problem by using
      returned hole size from ext4_map_blocks() and thus skip the hole in one
      go.
      
      Update also SEEK_HOLE implementation to follow the same pattern as
      SEEK_DATA to make future maintenance easier.
      
      Furthermore we add cond_resched() to both ext4_seek_data() and
      ext4_seek_hole() to avoid softlockups in case evil user creates huge
      fragmented file and we have to go through lots of extents.
      Signed-off-by: NJan Kara <jack@suse.cz>
      Signed-off-by: NTheodore Ts'o <tytso@mit.edu>
      2d90c160
    • J
      ext4: cleanup handling of bh->b_state in DAX mmap · e3fb8eb1
      Jan Kara 提交于
      ext4_dax_mmap_get_block() updates bh->b_state directly instead of using
      ext4_update_bh_state(). This is mostly a cosmetic issue since DAX code
      always passes on-stack buffer_head but clean this up to make code more
      uniform.
      Signed-off-by: NJan Kara <jack@suse.cz>
      Signed-off-by: NTheodore Ts'o <tytso@mit.edu>
      e3fb8eb1