1. 09 12月, 2009 7 次提交
  2. 08 12月, 2009 1 次提交
  3. 07 12月, 2009 1 次提交
  4. 01 12月, 2009 1 次提交
  5. 25 11月, 2009 2 次提交
  6. 24 11月, 2009 3 次提交
    • A
      ext4: move_extent_per_page() cleanup · ac48b0a1
      Akira Fujita 提交于
      Integrate duplicate lines (acquire/release semaphore and invalidate
      extent cache in move_extent_per_page()) into mext_replace_branches(),
      to reduce source and object code size.
      Signed-off-by: NAkira Fujita <a-fujita@rs.jp.nec.com>
      Signed-off-by: N"Theodore Ts'o" <tytso@mit.edu>
      ac48b0a1
    • K
      ext4: initialize moved_len before calling ext4_move_extents() · 446aaa6e
      Kazuya Mio 提交于
      The move_extent.moved_len is used to pass back the number of exchanged
      blocks count to user space.  Currently the caller must clear this
      field; but we spend more code space checking for this requirement than
      simply zeroing the field ourselves, so let's just make life easier for
      everyone all around.
      Signed-off-by: NKazuya Mio <k-mio@sx.jp.nec.com>
      Signed-off-by: NAkira Fujita <a-fujita@rs.jp.nec.com>
      Signed-off-by: N"Theodore Ts'o" <tytso@mit.edu>
      446aaa6e
    • A
      ext4: Fix double-free of blocks with EXT4_IOC_MOVE_EXT · 94d7c16c
      Akira Fujita 提交于
      At the beginning of ext4_move_extent(), we call
      ext4_discard_preallocations() to discard inode PAs of orig and donor
      inodes.  But in the following case, blocks can be double freed, so
      move ext4_discard_preallocations() to the end of ext4_move_extents().
      
      1. Discard inode PAs of orig and donor inodes with
         ext4_discard_preallocations() in ext4_move_extents().
      
         orig : [ DATA1 ]
         donor: [ DATA2 ]
      
      2. While data blocks are exchanging between orig and donor inodes, new
         inode PAs is created to orig by other process's block allocation.
         (Since there are semaphore gaps in ext4_move_extents().)  And new
         inode PAs is used partially (2-1).
      
         2-1 Create new inode PAs to orig inode
         orig : [ DATA1 | used PA1 | free PA1 ]
         donor: [ DATA2 ]
      
      3. Donor inode which has old orig inode's blocks is deleted after
         EXT4_IOC_MOVE_EXT finished (3-1, 3-2).  So the block bitmap
         corresponds to old orig inode's blocks are freed.
      
         3-1 After EXT4_IOC_MOVE_EXT finished
         orig : [ DATA2 |  free PA1 ]
         donor: [ DATA1 |  used PA1 ]
      
         3-2 Delete donor inode
         orig : [ DATA2 |  free PA1 ]
         donor: [ FREE SPACE(DATA1) | FREE SPACE(used PA1) ]
      
      4. The double-free of blocks is occurred, when close() is called to
         orig inode.  Because ext4_discard_preallocations() for orig inode
         frees used PA1 and free PA1, though used PA1 is already freed in 3.
      
         4-1 Double-free of blocks is occurred
         orig : [ DATA2 |  FREE SPACE(free PA1) ]
         donor: [ FREE SPACE(DATA1) | DOUBLE FREE(used PA1) ]
      Signed-off-by: NAkira Fujita <a-fujita@rs.jp.nec.com>
      Signed-off-by: N"Theodore Ts'o" <tytso@mit.edu>
      94d7c16c
  7. 23 11月, 2009 4 次提交
  8. 22 11月, 2009 1 次提交
  9. 23 11月, 2009 1 次提交
  10. 25 11月, 2009 1 次提交
  11. 23 11月, 2009 1 次提交
    • T
      ext4: move ext4_forget() to ext4_jbd2.c · d6797d14
      Theodore Ts'o 提交于
      The ext4_forget() function better belongs in ext4_jbd2.c.  This will
      allow us to do some cleanup of the ext4_journal_revoke() and
      ext4_journal_forget() functions, as well as giving us better error
      reporting since we can report the caller of ext4_forget() when things
      go wrong.
      Signed-off-by: N"Theodore Ts'o" <tytso@mit.edu>
      d6797d14
  12. 20 11月, 2009 2 次提交
  13. 23 11月, 2009 2 次提交
  14. 16 11月, 2009 1 次提交
  15. 23 11月, 2009 2 次提交
  16. 16 11月, 2009 2 次提交
  17. 23 11月, 2009 3 次提交
    • T
      ext4: make sure directory and symlink blocks are revoked · 50689696
      Theodore Ts'o 提交于
      When an inode gets unlinked, the functions ext4_clear_blocks() and
      ext4_remove_blocks() call ext4_forget() for all the buffer heads
      corresponding to the deleted inode's data blocks.  If the inode is a
      directory or a symlink, the is_metadata parameter must be non-zero so
      ext4_forget() will revoke them via jbd2_journal_revoke().  Otherwise,
      if these blocks are reused for a data file, and the system crashes
      before a journal checkpoint, the journal replay could end up
      corrupting these data blocks.
      
      Thanks to Curt Wohlgemuth for pointing out potential problems in this
      area.
      Signed-off-by: N"Theodore Ts'o" <tytso@mit.edu>
      Cc: stable@kernel.org
      50689696
    • T
      ext4: add tracepoint for ext4_forget() · beac2da7
      Theodore Ts'o 提交于
      Signed-off-by: N"Theodore Ts'o" <tytso@mit.edu>
      beac2da7
    • T
      ext4: remove failed journal checksum check · cf40db13
      Theodore Ts'o 提交于
      Now that we are checking for failed journal checksums in the jbd2
      layer, we don't need to check in the ext4 mount path --- since a
      checksum fail will result in ext4_load_journal() returning an error,
      causing the file system to refuse to be mounted until e2fsck can deal
      with the problem.
      Signed-off-by: N"Theodore Ts'o" <tytso@mit.edu>
      cf40db13
  18. 16 11月, 2009 1 次提交
    • T
      jbd2: don't wipe the journal on a failed journal checksum · e6a47428
      Theodore Ts'o 提交于
      If there is a failed journal checksum, don't reset the journal.  This
      allows for userspace programs to decide how to recover from this
      situation.  It may be that ignoring the journal checksum failure might
      be a better way of recovering the file system.  Once we add per-block
      checksums, we can definitely do better.  Until then, a system
      administrator can try backing up the file system image (or taking a
      snapshot) and and trying to determine experimentally whether ignoring
      the checksum failure or aborting the journal replay results in less
      data loss.
      Signed-off-by: N"Theodore Ts'o" <tytso@mit.edu>
      Cc: stable@kernel.org
      e6a47428
  19. 14 11月, 2009 1 次提交
  20. 23 11月, 2009 3 次提交
    • A
      ext4: fix spelling typos in move_extent.c · 92c28159
      Akira Fujita 提交于
      Fix a few spelling typos in move_extent.c
      Signed-off-by: NAkira Fujita <a-fujita@rs.jp.nec.co.jp>
      Signed-off-by: N"Theodore Ts'o" <tytso@mit.edu>
      92c28159
    • A
      ext4: fix possible recursive locking warning in EXT4_IOC_MOVE_EXT · 49bd22bc
      Akira Fujita 提交于
      If CONFIG_PROVE_LOCKING is enabled, the double_down_write_data_sem()
      will trigger a false-positive warning of a recursive lock.  Since we
      take i_data_sem for the two inodes ordered by their inode numbers,
      this isn't a problem.  Use of down_write_nested() will notify the lock
      dependency checker machinery that there is no problem here.
      
      This problem was reported by Brian Rogers:
      
      	http://marc.info/?l=linux-ext4&m=125115356928011&w=1Reported-by: NBrian Rogers <brian@xyzw.org>
      Signed-off-by: NAkira Fujita <a-fujita@rs.jp.nec.com>
      Signed-off-by: N"Theodore Ts'o" <tytso@mit.edu>
      49bd22bc
    • A
      ext4: fix lock order problem in ext4_move_extents() · fc04cb49
      Akira Fujita 提交于
      ext4_move_extents() checks the logical block contiguousness
      of original file with ext4_find_extent() and mext_next_extent().
      Therefore the extent which ext4_ext_path structure indicates
      must not be changed between above functions.
      
      But in current implementation, there is no i_data_sem protection
      between ext4_ext_find_extent() and mext_next_extent().  So the extent
      which ext4_ext_path structure indicates may be overwritten by
      delalloc.  As a result, ext4_move_extents() will exchange wrong blocks
      between original and donor files.  I change the place where
      acquire/release i_data_sem to solve this problem.
      
      Moreover, I changed move_extent_per_page() to start transaction first,
      and then acquire i_data_sem.  Without this change, there is a
      possibility of the deadlock between mmap() and ext4_move_extents():
      
      * NOTE: "A", "B" and "C" mean different processes
      
      A-1: ext4_ext_move_extents() acquires i_data_sem of two inodes.
      
      B:   do_page_fault() starts the transaction (T),
           and then tries to acquire i_data_sem.
           But process "A" is already holding it, so it is kept waiting.
      
      C:   While "A" and "B" running, kjournald2 tries to commit transaction (T)
           but it is under updating, so kjournald2 waits for it.
      
      A-2: Call ext4_journal_start with holding i_data_sem,
           but transaction (T) is locked.
      Signed-off-by: NAkira Fujita <a-fujita@rs.jp.nec.com>
      Signed-off-by: N"Theodore Ts'o" <tytso@mit.edu>
      fc04cb49