1. 23 7月, 2012 2 次提交
    • A
      ext4: remove unnecessary argument from __ext4_handle_dirty_metadata() · b50924c2
      Artem Bityutskiy 提交于
      The '__ext4_handle_dirty_metadata()' does not need the 'now' argument
      anymore and we can kill it.
      Signed-off-by: NArtem Bityutskiy <artem.bityutskiy@linux.intel.com>
      Signed-off-by: N"Theodore Ts'o" <tytso@mit.edu>
      Reviewed-by: NJan Kara <jack@suse.cz>
      b50924c2
    • A
      ext4: remove unnecessary superblock dirtying · 58c5873a
      Artem Bityutskiy 提交于
      This patch changes the 'ext4_handle_dirty_super()' function which
      submits the superblock for I/O in the following cases:
      
      1. When creating the first large file on a file system without
         EXT4_FEATURE_RO_COMPAT_LARGE_FILE feature.
      2. When re-sizing the file-system.
      3. When creating an xattr on a file-system without the
         EXT4_FEATURE_COMPAT_EXT_ATTR feature.
      
      If the file-system has journal enabled, the superblock is written via
      the journal. We do not modify this path.
      
      If the file-system has no journal, this function, falls back to just
      marking the superblock as dirty using the 's_dirt' superblock
      flag. This means that it delays the actual superblock I/O submission
      by 5 seconds (default setting).  Namely, the 'sync_supers()' kernel
      thread will call 'ext4_write_super()' later and will actually submit
      the superblock for I/O.
      
      And this is the behavior this patch modifies: we stop using 's_dirt'
      and just mark the superblock buffer as dirty right away. Indeed, all 3
      cases above are extremely rare and it does not add any value to delay
      the I/O submission for them.
      
      Note: 'ext4_handle_dirty_super()' executes
      '__ext4_handle_dirty_super()' with 'now = 0'. This patch basically
      makes the 'now' argument unneeded and it will be deleted in one of the
      next patches.
      
      This patch also removes 's_dirt' condition on the unmount path because
      we never set it anymore, so we should not test it.
      
      Tested using xfstests for both journalled and non-journalled ext4.
      Signed-off-by: NArtem Bityutskiy <artem.bityutskiy@linux.intel.com>
      Signed-off-by: N"Theodore Ts'o" <tytso@mit.edu>
      Reviewed-by: NJan Kara <jack@suse.cz>
      58c5873a
  2. 30 4月, 2012 1 次提交
  3. 04 9月, 2011 1 次提交
    • T
      jbd2: add debugging information to jbd2_journal_dirty_metadata() · 9ea7a0df
      Theodore Ts'o 提交于
      Add debugging information in case jbd2_journal_dirty_metadata() is
      called with a buffer_head which didn't have
      jbd2_journal_get_write_access() called on it, or if the journal_head
      has the wrong transaction in it.  In addition, return an error code.
      This won't change anything for ocfs2, which will BUG_ON() the non-zero
      exit code.
      
      For ext4, the caller of this function is ext4_handle_dirty_metadata(),
      and on seeing a non-zero return code, will call __ext4_journal_stop(),
      which will print the function and line number of the (buggy) calling
      function and abort the journal.  This will allow us to recover instead
      of bug halting, which is better from a robustness and reliability
      point of view.
      Signed-off-by: N"Theodore Ts'o" <tytso@mit.edu>
      9ea7a0df
  4. 09 5月, 2011 1 次提交
    • T
      ext4: remove unneeded ext4_journal_get_undo_access · 2cd05cc3
      Theodore Ts'o 提交于
      The block allocation code used to use jbd2_journal_get_undo_access as
      a way to make changes that wouldn't show up until the commit took
      place.  The new multi-block allocation code has a its own way of
      preventing newly freed blocks from getting reused until the commit
      takes place (it avoids updating the buddy bitmaps until the commit is
      done), so we don't need to use jbd2_journal_get_undo_access(), which
      has extra overhead compared to jbd2_journal_get_write_access().
      
      There was one last vestigal use of ext4_journal_get_undo_access() in
      ext4_add_groupblocks(); change it to use ext4_journal_get_write_access()
      and then remove the ext4_journal_get_undo_access() support.
      Signed-off-by: N"Theodore Ts'o" <tytso@mit.edu>
      2cd05cc3
  5. 27 7月, 2010 2 次提交
  6. 30 6月, 2010 1 次提交
  7. 29 6月, 2010 1 次提交
  8. 12 6月, 2010 1 次提交
    • T
      ext4: Clean up s_dirt handling · a0375156
      Theodore Ts'o 提交于
      We don't need to set s_dirt in most of the ext4 code when journaling
      is enabled.  In ext3/4 some of the summary statistics for # of free
      inodes, blocks, and directories are calculated from the per-block
      group statistics when the file system is mounted or unmounted.  As a
      result the superblock doesn't have to be updated, either via the
      journal or by setting s_dirt.  There are a few exceptions, most
      notably when resizing the file system, where the superblock needs to
      be modified --- and in that case it should be done as a journalled
      operation if possible, and s_dirt set only in no-journal mode.
      
      This patch will optimize out some unneeded disk writes when using ext4
      with a journal.
      Signed-off-by: N"Theodore Ts'o" <tytso@mit.edu>
      a0375156
  9. 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
  10. 16 2月, 2010 1 次提交
  11. 23 11月, 2009 1 次提交
  12. 25 11月, 2009 1 次提交
  13. 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
  14. 13 9月, 2009 1 次提交
  15. 10 9月, 2009 1 次提交
    • T
      ext4: Use bforget() in no journal mode for ext4_journal_{forget,revoke}() · c7acb4c1
      Theodore Ts'o 提交于
      When ext4 is using a journal, a metadata block which is deallocated
      must be passed into the journal layer so it can be dropped from the
      current transaction and/or revoked.  This is done by calling the
      functions ext4_journal_forget() and ext4_journal_revoke(), which call
      jbd2_journal_forget(), and jbd2_journal_revoke(), respectively.
      
      Since the jbd2_journal_forget() and jbd2_journal_revoke() call
      bforget(), if ext4 is not using a journal, ext4_journal_forget() and
      ext4_journal_revoke() must call bforget() to avoid a dirty metadata
      block overwriting a block after it has been reallocated and reused for
      another inode's data block.
      Signed-off-by: N"Theodore Ts'o" <tytso@mit.edu>
      c7acb4c1
  16. 13 7月, 2009 1 次提交
    • C
      ext4: Fix buffer head reference leak in no-journal mode · e6b5d301
      Curt Wohlgemuth 提交于
      We found a problem with buffer head reference leaks when using an ext4
      partition without a journal.  In particular, calls to ext4_forget() would
      not to a brelse() on the input buffer head, which will cause pages they
      belong to to not be reclaimable.
      
      Further investigation showed that all places where ext4_journal_forget() and
      ext4_journal_revoke() are called are subject to the same problem.  The patch
      below changes __ext4_journal_forget/__ext4_journal_revoke to do an explicit
      release of the buffer head when the journal handle isn't valid.
      Signed-off-by: NCurt Wohlgemuth <curtw@google.com>
      Signed-off-by: N"Theodore Ts'o" <tytso@mit.edu>
      e6b5d301
  17. 07 1月, 2009 1 次提交
    • F
      ext4: Allow ext4 to run without a journal · 0390131b
      Frank Mayhar 提交于
      A few weeks ago I posted a patch for discussion that allowed ext4 to run
      without a journal.  Since that time I've integrated the excellent
      comments from Andreas and fixed several serious bugs.  We're currently
      running with this patch and generating some performance numbers against
      both ext2 (with backported reservations code) and ext4 with and without
      a journal.  It just so happens that running without a journal is
      slightly faster for most everything.
      
      We did
      	iozone -T -t 4 s 2g -r 256k -T -I -i0 -i1 -i2
      
      which creates 4 threads, each of which create and do reads and writes on
      a 2G file, with a buffer size of 256K, using O_DIRECT for all file opens
      to bypass the page cache.  Results:
      
                           ext2        ext4, default   ext4, no journal
        initial writes   13.0 MB/s        15.4 MB/s          15.7 MB/s
        rewrites         13.1 MB/s        15.6 MB/s          15.9 MB/s
        reads            15.2 MB/s        16.9 MB/s          17.2 MB/s
        re-reads         15.3 MB/s        16.9 MB/s          17.2 MB/s
        random readers    5.6 MB/s         5.6 MB/s           5.7 MB/s
        random writers    5.1 MB/s         5.3 MB/s           5.4 MB/s 
      
      So it seems that, so far, this was a useful exercise.
      Signed-off-by: NFrank Mayhar <fmayhar@google.com>
      Signed-off-by: N"Theodore Ts'o" <tytso@mit.edu>
      0390131b
  18. 30 4月, 2008 1 次提交
  19. 17 4月, 2008 1 次提交
  20. 08 12月, 2006 1 次提交