1. 20 7月, 2011 1 次提交
  2. 26 5月, 2011 3 次提交
  3. 15 5月, 2011 1 次提交
  4. 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
  5. 22 3月, 2011 1 次提交
  6. 21 3月, 2011 1 次提交
  7. 15 3月, 2011 1 次提交
  8. 11 1月, 2011 3 次提交
  9. 20 12月, 2010 2 次提交
  10. 15 12月, 2010 1 次提交
  11. 28 10月, 2010 2 次提交
    • T
      ext4: use search_dirblock() in ext4_dx_find_entry() · 7845c049
      Theodore Ts'o 提交于
      Use the search_dirblock() in ext4_dx_find_entry().  It makes the code
      easier to read, and it takes advantage of common code.  It also saves
      100 bytes or so of text space.
      Signed-off-by: N"Theodore Ts'o" <tytso@mit.edu>
      Cc: Brad Spengler <spender@grsecurity.net>
      7845c049
    • T
      ext4: avoid uninitialized memory references in ext3_htree_next_block() · 8941ec8b
      Theodore Ts'o 提交于
      If the first block of htree directory is missing '.' or '..' but is
      otherwise a valid directory, and we do a lookup for '.' or '..', it's
      possible to dereference an uninitialized memory pointer in
      ext4_htree_next_block().
      
      We avoid this by moving the special case from ext4_dx_find_entry() to
      ext4_find_entry(); this also means we can optimize ext4_find_entry()
      slightly when NFS looks up "..".
      
      Thanks to Brad Spengler for pointing a Clang warning that led me to
      look more closely at this code.  The warning was harmless, but it was
      useful in pointing out code that was too ugly to live.  This warning was
      also reported by Roman Borisov.
      Signed-off-by: N"Theodore Ts'o" <tytso@mit.edu>
      Cc: Brad Spengler <spender@grsecurity.net>
      8941ec8b
  12. 26 10月, 2010 1 次提交
  13. 05 8月, 2010 1 次提交
    • E
      ext4: re-inline ext4_rec_len_(to|from)_disk functions · 0cfc9255
      Eric Sandeen 提交于
      commit 3d0518f4, "ext4: New rec_len encoding for very
      large blocksizes" made several changes to this path, but from
      a perf perspective, un-inlining ext4_rec_len_from_disk() seems
      most significant.  This function is called from ext4_check_dir_entry(),
      which on a file-creation workload is called extremely often.
      
      I tested this with bonnie:
      
      # bonnie++ -u root -s 0 -f -x 200 -d /mnt/test -n 32
      
      (this does 200 iterations) and got this for the file creations:
      
      ext4 stock:   Average =  21206.8 files/s
      ext4 inlined: Average =  22346.7 files/s  (+5%)
      Signed-off-by: NEric Sandeen <sandeen@redhat.com>
      Signed-off-by: N"Theodore Ts'o" <tytso@mit.edu>
      0cfc9255
  14. 27 7月, 2010 1 次提交
  15. 15 6月, 2010 1 次提交
  16. 17 5月, 2010 4 次提交
  17. 05 3月, 2010 2 次提交
    • C
      dquot: cleanup dquot initialize routine · 871a2931
      Christoph Hellwig 提交于
      Get rid of the initialize dquot operation - it is now always called from
      the filesystem and if a filesystem really needs it's own (which none
      currently does) it can just call into it's own routine directly.
      
      Rename the now static low-level dquot_initialize helper to __dquot_initialize
      and vfs_dq_init to dquot_initialize to have a consistent namespace.
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NJan Kara <jack@suse.cz>
      871a2931
    • C
      dquot: move dquot initialization responsibility into the filesystem · 907f4554
      Christoph Hellwig 提交于
      Currently various places in the VFS call vfs_dq_init directly.  This means
      we tie the quota code into the VFS.  Get rid of that and make the
      filesystem responsible for the initialization.   For most metadata operations
      this is a straight forward move into the methods, but for truncate and
      open it's a bit more complicated.
      
      For truncate we currently only call vfs_dq_init for the sys_truncate case
      because open already takes care of it for ftruncate and open(O_TRUNC) - the
      new code causes an additional vfs_dq_init for those which is harmless.
      
      For open the initialization is moved from do_filp_open into the open method,
      which means it happens slightly earlier now, and only for regular files.
      The latter is fine because we don't need to initialize it for operations
      on special files, and we already do it as part of the namespace operations
      for directories.
      
      Add a dquot_file_open helper that filesystems that support generic quotas
      can use to fill in ->open.
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NJan Kara <jack@suse.cz>
      907f4554
  18. 02 3月, 2010 1 次提交
  19. 17 2月, 2010 1 次提交
    • C
      ext4: Fix BUG_ON at fs/buffer.c:652 in no journal mode · 73b50c1c
      Curt Wohlgemuth 提交于
      Calls to ext4_handle_dirty_metadata should only pass in an inode
      pointer for inode-specific metadata, and not for shared metadata
      blocks such as inode table blocks, block group descriptors, the
      superblock, etc.
      
      The BUG_ON can get tripped when updating a special device (such as a
      block device) that is opened (so that i_mapping is set in
      fs/block_dev.c) and the file system is mounted in no journal mode.
      
      Addresses-Google-Bug: #2404870
      Signed-off-by: NCurt Wohlgemuth <curtw@google.com>
      Signed-off-by: N"Theodore Ts'o" <tytso@mit.edu>
      73b50c1c
  20. 16 2月, 2010 1 次提交
  21. 09 12月, 2009 1 次提交
  22. 23 11月, 2009 1 次提交
    • T
      ext4: fix potential buffer head leak when add_dirent_to_buf() returns ENOSPC · 2de770a4
      Theodore Ts'o 提交于
      Previously add_dirent_to_buf() did not free its passed-in buffer head
      in the case of ENOSPC, since in some cases the caller still needed it.
      However, this led to potential buffer head leaks since not all callers
      dealt with this correctly.  Fix this by making simplifying the freeing
      convention; now add_dirent_to_buf() *never* frees the passed-in buffer
      head, and leaves that to the responsibility of its caller.  This makes
      things cleaner and easier to prove that the code is neither leaking
      buffer heads or calling brelse() one time too many.
      Signed-off-by: N"Theodore Ts'o" <tytso@mit.edu>
      Cc: Curt Wohlgemuth <curtw@google.com>
      Cc: stable@kernel.org
      2de770a4
  23. 09 11月, 2009 1 次提交
    • T
      ext4: partial revert to fix double brelse WARNING() · 1e424a34
      Theodore Ts'o 提交于
      This is a partial revert of commit 6487a9d3 (only the changes made to
      fs/ext4/namei.c), since it is causing the following brelse()
      double-free warning when running fsstress on a file system with 1k
      blocksize and we run into a block allocation failure while converting
      a single-block directory to a multi-block hash-tree indexed directory.
      
      WARNING: at fs/buffer.c:1197 __brelse+0x2e/0x33()
      Hardware name: 
      VFS: brelse: Trying to free free buffer
      Modules linked in:
      Pid: 2226, comm: jbd2/sdd-8 Not tainted 2.6.32-rc6-00577-g0003f55 #101
      Call Trace:
       [<c01587fb>] warn_slowpath_common+0x65/0x95
       [<c0158869>] warn_slowpath_fmt+0x29/0x2c
       [<c021168e>] __brelse+0x2e/0x33
       [<c0288a9f>] jbd2_journal_refile_buffer+0x67/0x6c
       [<c028a9ed>] jbd2_journal_commit_transaction+0x319/0x14d8
       [<c0164d73>] ? try_to_del_timer_sync+0x58/0x60
       [<c0175bcc>] ? sched_clock_cpu+0x12a/0x13e
       [<c017f6b4>] ? trace_hardirqs_off+0xb/0xd
       [<c0175c1f>] ? cpu_clock+0x3f/0x5b
       [<c017f6ec>] ? lock_release_holdtime+0x36/0x137
       [<c0664ad0>] ? _spin_unlock_irqrestore+0x44/0x51
       [<c0180af3>] ? trace_hardirqs_on_caller+0x103/0x124
       [<c0180b1f>] ? trace_hardirqs_on+0xb/0xd
       [<c0164d73>] ? try_to_del_timer_sync+0x58/0x60
       [<c0290d1c>] kjournald2+0x11a/0x310
       [<c017118e>] ? autoremove_wake_function+0x0/0x38
       [<c0290c02>] ? kjournald2+0x0/0x310
       [<c0170ee6>] kthread+0x66/0x6b
       [<c0170e80>] ? kthread+0x0/0x6b
       [<c01251b3>] kernel_thread_helper+0x7/0x10
      ---[ end trace 5579351b86af61e3 ]---
      
      Commit 6487a9d3 was an attempt some buffer head leaks in an ENOSPC
      error path, but in some cases it actually results in an excess ENOSPC,
      as shown above.  Fixing this means cleaning up who is responsible for
      releasing the buffer heads from the callee to the caller of
      add_dirent_to_buf().
      
      Since that's a relatively complex change, and we're late in the rcX
      development cycle, I'm reverting this now, and holding back a more
      complete fix until after 2.6.32 ships.  We've lived with this
      buffer_head leak on ENOSPC in ext3 and ext4 for a very long time; a
      few more months won't kill us.
      Signed-off-by: N"Theodore Ts'o" <tytso@mit.edu>
      Cc: Curt Wohlgemuth <curtw@google.com>
      1e424a34
  24. 29 9月, 2009 1 次提交
  25. 11 9月, 2009 1 次提交
  26. 09 9月, 2009 1 次提交
  27. 30 8月, 2009 1 次提交
  28. 29 8月, 2009 1 次提交
  29. 17 7月, 2009 1 次提交
    • C
      ext4: More buffer head reference leaks · 6487a9d3
      Curt Wohlgemuth 提交于
      After the patch I posted last week regarding buffer head ref leaks in
      no-journal mode, I looked at all the code that uses buffer heads and
      searched for more potential leaks.
      
      The patch below fixes the issues I found; these can occur even when a
      journal is present.
      
      The change to inode.c fixes a double release if
      ext4_journal_get_create_access() fails.
      
      The changes to namei.c are more complicated.  add_dirent_to_buf() will
      release the input buffer head EXCEPT when it returns -ENOSPC.  There are
      some callers of this routine that don't always do the brelse() in the event
      that -ENOSPC is returned.  Unfortunately, to put this fix into ext4_add_entry()
      required capturing the return value of make_indexed_dir() and
      add_dirent_to_buf().
      Signed-off-by: NCurt Wohlgemuth <curtw@google.com>
      Signed-off-by: N"Theodore Ts'o" <tytso@mit.edu>
      6487a9d3