1. 18 9月, 2012 1 次提交
    • C
      ext4: fix possible non-initialized variable in htree_dirblock_to_tree() · 90b0a973
      Carlos Maiolino 提交于
      htree_dirblock_to_tree() declares a non-initialized 'err' variable,
      which is passed as a reference to another functions expecting them to
      set this variable with their error codes.
      
      It's passed to ext4_bread(), which then passes it to ext4_getblk(). If
      ext4_map_blocks() returns 0 due to a lookup failure, leaving the
      ext4_getblk() buffer_head uninitialized, it will make ext4_getblk()
      return to ext4_bread() without initialize the 'err' variable, and
      ext4_bread() will return to htree_dirblock_to_tree() with this variable
      still uninitialized.  htree_dirblock_to_tree() will pass this variable
      with garbage back to ext4_htree_fill_tree(), which expects a number of
      directory entries added to the rb-tree. which, in case, might return a
      fake non-zero value due the garbage left in the 'err' variable, leading
      the kernel to an Oops in ext4_dx_readdir(), once this is expecting a
      filled rb-tree node, when in turn it will have a NULL-ed one, causing an
      invalid page request when trying to get a fname struct from this NULL-ed
      rb-tree node in this line:
      
      fname = rb_entry(info->curr_node, struct fname, rb_hash);
      
      The patch itself initializes the err variable in
      htree_dirblock_to_tree() to avoid usage mistakes by the called
      functions, and also fix ext4_getblk() to return a initialized 'err'
      variable when ext4_map_blocks() fails a lookup.
      Signed-off-by: NCarlos Maiolino <cmaiolino@redhat.com>
      Signed-off-by: N"Theodore Ts'o" <tytso@mit.edu>
      90b0a973
  2. 17 8月, 2012 1 次提交
    • T
      ext4: add max_dir_size_kb mount option · df981d03
      Theodore Ts'o 提交于
      Very large directories can cause significant performance problems, or
      perhaps even invoke the OOM killer, if the process is running in a
      highly constrained memory environment (whether it is VM's with a small
      amount of memory or in a small memory cgroup).
      
      So it is useful, in cloud server/data center environments, to be able
      to set a filesystem-wide cap on the maximum size of a directory, to
      ensure that directories never get larger than a sane size.  We do this
      via a new mount option, max_dir_size_kb.  If there is an attempt to
      grow the directory larger than max_dir_size_kb, the system call will
      return ENOSPC instead.
      
      Google-Bug-Id: 6863013
      Signed-off-by: N"Theodore Ts'o" <tytso@mit.edu>
      
      
      
      df981d03
  3. 23 7月, 2012 2 次提交
  4. 14 7月, 2012 2 次提交
  5. 10 7月, 2012 1 次提交
  6. 29 5月, 2012 1 次提交
  7. 11 5月, 2012 1 次提交
    • L
      vfs: make it possible to access the dentry hash/len as one 64-bit entry · 26fe5750
      Linus Torvalds 提交于
      This allows comparing hash and len in one operation on 64-bit
      architectures.  Right now only __d_lookup_rcu() takes advantage of this,
      since that is the case we care most about.
      
      The use of anonymous struct/unions hides the alternate 64-bit approach
      from most users, the exception being a few cases where we initialize a
      'struct qstr' with a static initializer.  This makes the problematic
      cases use a new QSTR_INIT() helper function for that (but initializing
      just the name pointer with a "{ .name = xyzzy }" initializer remains
      valid, as does just copying another qstr structure).
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      26fe5750
  8. 30 4月, 2012 5 次提交
  9. 21 2月, 2012 1 次提交
  10. 09 1月, 2012 1 次提交
    • A
      ext[34]: avoid i_nlink warnings triggered by drop_nlink/inc_nlink kludge in symlink() · 0ce8c010
      Al Viro 提交于
      Both ext3 and ext4 put the half-created symlink inode into the orphan list
      for a while (see the comment in ext[34]_symlink() for gory details).  Then,
      if everything went fine, they pull it out of the orphan list and bump the
      link count back to 1.  The thing is, inc_nlink() is going to complain about
      seeing somebody changing i_nlink from 0 to 1.  With a good reason, since
      normally something like that is a bug.  Explicit set_nlink(inode, 1) does
      the same thing as inc_nlink() here, but it does *not* complain - exactly
      because it should be usable in strange situations like this one.
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      0ce8c010
  11. 04 1月, 2012 3 次提交
  12. 02 11月, 2011 2 次提交
  13. 29 10月, 2011 1 次提交
  14. 26 10月, 2011 1 次提交
  15. 01 9月, 2011 2 次提交
  16. 31 8月, 2011 1 次提交
  17. 23 8月, 2011 2 次提交
  18. 12 8月, 2011 1 次提交
  19. 26 7月, 2011 1 次提交
  20. 20 7月, 2011 1 次提交
  21. 17 7月, 2011 1 次提交
  22. 12 7月, 2011 1 次提交
    • L
      ext4: remove unnecessary comments in ext4_orphan_add() · afb86178
      Lukas Czerner 提交于
      The comment from Al Viro about possible race in the ext4_orphan_add() is
      not justified. There is no race possible as we always have either i_mutex
      locked, or the inode can not be referenced from outside hence the
      J_ASSERS should not be hit from the reason described in comment.
      
      This commit replaces it with notion that we are holding i_mutex so it
      should not be possible for i_nlink to be changed while waiting for
      s_orphan_lock.
      Signed-off-by: NLukas Czerner <lczerner@redhat.com>
      Signed-off-by: N"Theodore Ts'o" <tytso@mit.edu>
      afb86178
  23. 26 5月, 2011 3 次提交
  24. 15 5月, 2011 1 次提交
  25. 03 5月, 2011 2 次提交
    • J
      ext4: fix deadlock in ext4_symlink() in ENOSPC conditions · df5e6223
      Jan Kara 提交于
      ext4_symlink() cannot call __page_symlink() with transaction open.
      __page_symlink() calls ext4_write_begin() which can wait for
      transaction commit if we are running out of space thus causing a
      deadlock. Also error recovery in ext4_truncate_failed_write() does not
      count with the transaction being already started (although I'm not
      aware of any particular deadlock here).
      
      Fix the problem by stopping a transaction before calling
      __page_symlink() (we have to be careful and put inode to orphan list
      so that it gets deleted in case of crash) and starting another one
      after __page_symlink() returns for addition of symlink into a
      directory.
      Signed-off-by: NJan Kara <jack@suse.cz>
      Signed-off-by: N"Theodore Ts'o" <tytso@mit.edu>
      df5e6223
    • J
      ext4: Fix fs corruption when make_indexed_dir() fails · 7ad8e4e6
      Jan Kara 提交于
      When make_indexed_dir() fails (e.g. because of ENOSPC) after it has
      allocated block for index tree root, we did not properly mark all
      changed buffers dirty.  This lead to only some of these buffers being
      written out and thus effectively corrupting the directory.
      
      Fix the issue by marking all changed data dirty even in the error
      failure case.
      Signed-off-by: NJan Kara <jack@suse.cz>
      Signed-off-by: N"Theodore Ts'o" <tytso@mit.edu>
      7ad8e4e6
  26. 22 3月, 2011 1 次提交