1. 26 10月, 2011 7 次提交
  2. 25 10月, 2011 3 次提交
    • D
      ext4: prevent stack overrun in ext4_file_open · cf803903
      Darrick J. Wong 提交于
      In ext4_file_open, the filesystem records the mountpoint of the first
      file that is opened after mounting the filesystem.  It does this by
      allocating a 64-byte stack buffer, calling d_path() to grab the mount
      point through which this file was accessed, and then memcpy()ing 64
      bytes into the superblock's s_last_mounted field, starting from the
      return value of d_path(), which is stored as "cp".  However, if cp >
      buf (which it frequently is since path components are prepended
      starting at the end of buf) then we can end up copying stack data into
      the superblock.
      
      Writing stack variables into the superblock doesn't sound like a great
      idea, so use strlcpy instead.  Andi Kleen suggested using strlcpy
      instead of strncpy.
      Signed-off-by: NDarrick J. Wong <djwong@us.ibm.com>
      Signed-off-by: N"Theodore Ts'o" <tytso@mit.edu>
      cf803903
    • D
      ext4: update EOFBLOCKS flag on fallocate properly · a4e5d88b
      Dmitry Monakhov 提交于
      EOFBLOCK_FL should be updated if called w/o FALLOCATE_FL_KEEP_SIZE
      Currently it happens only if new extent was allocated.
      
      TESTCASE:
      fallocate test_file -n -l4096
      fallocate test_file -l4096
      Last fallocate cmd has updated size, but keept EOFBLOCK_FL set. And
      fsck will complain about that.
      
      Also remove ping pong in ext4_fallocate() in case of new extents,
      where ext4_ext_map_blocks() clear EOFBLOCKS bit, and later
      ext4_falloc_update_inode() restore it again.
      Signed-off-by: NDmitry Monakhov <dmonakhov@openvz.org>
      Signed-off-by: N"Theodore Ts'o" <tytso@mit.edu>
      a4e5d88b
    • D
      ext4: remove messy logic from ext4_ext_rm_leaf · 750c9c47
      Dmitry Monakhov 提交于
      - Both callers(truncate and punch_hole) already aligned left end point
        so we no longer need split logic here.
      - Remove dead duplicated code.
      - Call ext4_ext_dirty only after we have updated eh_entries, otherwise
        we'll loose entries update. Regression caused by d583fb87
        266'th testcase in xfstests (http://patchwork.ozlabs.org/patch/120872)
      Signed-off-by: NDmitry Monakhov <dmonakhov@openvz.org>
      Signed-off-by: N"Theodore Ts'o" <tytso@mit.edu>
      750c9c47
  3. 22 10月, 2011 1 次提交
    • D
      ext4: cleanup ext4_ext_grow_indepth code · 1939dd84
      Dmitry Monakhov 提交于
      Currently code make an impression what grow procedure is very complicated
      and some mythical paths, blocks are involved. But in fact grow in depth
      it relatively simple procedure:
       1) Just create new meta block and copy root data to that block.
       2) Convert root from extent to index if old depth == 0
       3) Update root block pointer
      
      This patch does:
       - Reorganize code to make it more self explanatory
       - Do not pass path parameter to new_meta_block() in order to
         provoke allocation from inode's group because top-level block
         should site closer to it's inode, but not to leaf data block.
      
         [ This happens anyway, due to logic in mballoc; we should drop
           the path parameter from new_meta_block() entirely.  -- tytso ]
      Signed-off-by: NDmitry Monakhov <dmonakhov@openvz.org>
      Signed-off-by: N"Theodore Ts'o" <tytso@mit.edu>
      1939dd84
  4. 21 10月, 2011 3 次提交
  5. 18 10月, 2011 7 次提交
  6. 17 10月, 2011 1 次提交
  7. 09 10月, 2011 6 次提交
  8. 07 10月, 2011 1 次提交
  9. 06 10月, 2011 1 次提交
  10. 10 9月, 2011 10 次提交