1. 11 4月, 2011 3 次提交
    • K
      ext4: Allow indirect-block file to grow the file size to max file size · f80da1e7
      Kazuya Mio 提交于
      We can create 4402345721856 byte file with indirect block mapping.
      However, if we grow an indirect-block file to the size with ftruncate(),
      we can see an ext4 warning. The following patch fixes this problem.
      
      How to reproduce:
      # dd if=/dev/zero of=/mnt/mp1/hoge bs=1 count=0 seek=4402345721856
      0+0 records in
      0+0 records out
      0 bytes (0 B) copied, 0.000221428 s, 0.0 kB/s
      # tail -n 1 /var/log/messages
      Nov 25 15:10:27 test kernel: EXT4-fs warning (device sda8): ext4_block_to_path:345: block 1074791436 > max in inode 12
      Signed-off-by: NKazuya Mio <k-mio@sx.jp.nec.com>
      Signed-off-by: N"Theodore Ts'o" <tytso@mit.edu>
      f80da1e7
    • Y
      ext4: allow an active handle to be started when freezing · be4f27d3
      Yongqiang Yang 提交于
      ext4_journal_start_sb() should not prevent an active handle from being
      started due to s_frozen.  Otherwise, deadlock is easy to happen, below
      is a situation.
      
      ================================================
           freeze         |       truncate
      ================================================
                          |  ext4_ext_truncate()
          freeze_super()  |   starts a handle
          sets s_frozen   |
                          |  ext4_ext_truncate()
                          |  holds i_data_sem
        ext4_freeze()     |
        waits for updates |
                          |  ext4_free_blocks()
                          |  calls dquot_free_block()
                          |
                          |  dquot_free_blocks()
                          |  calls ext4_dirty_inode()
                          |
                          |  ext4_dirty_inode()
                          |  trys to start an active
                          |  handle
                          |
                          |  block due to s_frozen
      ================================================
      Signed-off-by: NYongqiang Yang <xiaoqiangnk@gmail.com>
      Signed-off-by: N"Theodore Ts'o" <tytso@mit.edu>
      Reported-by: NAmir Goldstein <amir73il@users.sf.net>
      Reviewed-by: NJan Kara <jack@suse.cz>
      Reviewed-by: NAndreas Dilger <adilger@dilger.ca>
      be4f27d3
    • C
      ext4: sync the directory inode in ext4_sync_parent() · 0893ed45
      Curt Wohlgemuth 提交于
      ext4 has taken the stance that, in the absence of a journal,
      when an fsync/fdatasync of an inode is done, the parent
      directory should be sync'ed if this inode entry is new.
      ext4_sync_parent(), which implements this, does indeed sync
      the dirent pages for parent directories, but it does not
      sync the directory *inode*.  This patch fixes this.
      
      Also now return error status from ext4_sync_parent().
      
      I tested this using a power fail test, which panics a
      machine running a file server getting requests from a
      client.  Without this patch, on about every other test run,
      the server is missing many, many files that had been synced.
      With this patch, on > 6 runs, I see zero files being lost.
      
      Google-Bug-Id: 4179519
      Signed-off-by: NCurt Wohlgemuth <curtw@google.com>
      Signed-off-by: N"Theodore Ts'o" <tytso@mit.edu>
      0893ed45
  2. 06 4月, 2011 2 次提交
    • T
      ext4: init timer earlier to avoid a kernel panic in __save_error_info · 04496411
      Tao Ma 提交于
      During mount, when we fail to open journal inode or root inode, the
      __save_error_info will mod_timer. But actually s_err_report isn't
      initialized yet and the kernel oops. The detailed information can
      be found https://bugzilla.kernel.org/show_bug.cgi?id=32082.
      
      The best way is to check whether the timer s_err_report is initialized
      or not. But it seems that in include/linux/timer.h, we can't find a
      good function to check the status of this timer, so this patch just
      move the initializtion of s_err_report earlier so that we can avoid
      the kernel panic. The corresponding del_timer is also added in the
      error path.
      Reported-by: NSami Liedes <sliedes@cc.hut.fi>
      Signed-off-by: NTao Ma <boyu.mt@taobao.com>
      Signed-off-by: N"Theodore Ts'o" <tytso@mit.edu>
      04496411
    • Z
      jbd2: fix potential memory leak on transaction commit · 6cba611e
      Zhang Huan 提交于
      There is potential memory leak of journal head in function
      jbd2_journal_commit_transaction. The problem is that JBD2 will not
      reclaim the journal head of commit record if error occurs or journal
      is abotred.
      
      I use the following script to reproduce this issue, on a RHEL6
      system. I found it very easy to reproduce with async commit enabled.
      
      mount /dev/sdb /mnt -o journal_checksum,journal_async_commit
      touch /mnt/xxx
      echo offline > /sys/block/sdb/device/state
      sync
      umount /mnt
      rmmod ext4
      rmmod jbd2
      
      Removal of the jbd2 module will make slab complaining that
      "cache `jbd2_journal_head': can't free all objects".
      Signed-off-by: NZhang Huan <zhhuan@gmail.com>
      Signed-off-by: N"Theodore Ts'o" <tytso@mit.edu>
      6cba611e
  3. 05 4月, 2011 4 次提交
  4. 30 3月, 2011 9 次提交
  5. 29 3月, 2011 22 次提交