1. 16 2月, 2010 1 次提交
  2. 07 12月, 2009 1 次提交
    • T
      ext4: Use slab allocator for sub-page sized allocations · d2eecb03
      Theodore Ts'o 提交于
      Now that the SLUB seems to be fixed so that it respects the requested
      alignment, use kmem_cache_alloc() to allocator if the block size of
      the buffer heads to be allocated is less than the page size.
      Previously, we were using 16k page on a Power system for each buffer,
      even when the file system was using 1k or 4k block size.
      Signed-off-by: N"Theodore Ts'o" <tytso@mit.edu>
      
      d2eecb03
  3. 23 12月, 2009 4 次提交
  4. 18 12月, 2009 1 次提交
  5. 16 12月, 2009 1 次提交
  6. 10 12月, 2009 2 次提交
  7. 01 12月, 2009 1 次提交
  8. 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
  9. 11 11月, 2009 1 次提交
  10. 02 10月, 2009 1 次提交
  11. 30 9月, 2009 2 次提交
  12. 23 9月, 2009 1 次提交
  13. 16 9月, 2009 1 次提交
  14. 11 9月, 2009 1 次提交
    • T
      ext4: Fix async commit mode to be safe by using a barrier · 0e3d2a63
      Theodore Ts'o 提交于
      Previously the journal_async_commit mount option was equivalent to
      using barrier=0 (and just as unsafe).  This patch fixes it so that we
      eliminate the barrier before the commit block (by not using ordered
      mode), and explicitly issuing an empty barrier bio after writing the
      commit block.  Because of the journal checksum, it is safe to do this;
      if the journal blocks are not all written before a power failure, the
      checksum in the commit block will prevent the last transaction from
      being replayed.
      
      Using the fs_mark benchmark, using journal_async_commit shows a 50%
      improvement:
      
      FSUse%        Count         Size    Files/sec     App Overhead
           8         1000        10240         30.5            28242
      
      vs.
      
      FSUse%        Count         Size    Files/sec     App Overhead
           8         1000        10240         45.8            28620
      Signed-off-by: N"Theodore Ts'o" <tytso@mit.edu>
      0e3d2a63
  15. 18 8月, 2009 1 次提交
  16. 11 8月, 2009 1 次提交
  17. 14 7月, 2009 1 次提交
    • D
      jbd2: fix race between write_metadata_buffer and get_write_access · 96577c43
      dingdinghua 提交于
      The function jbd2_journal_write_metadata_buffer() calls
      jbd_unlock_bh_state(bh_in) too early; this could potentially allow
      another thread to call get_write_access on the buffer head, modify the
      data, and dirty it, and allowing the wrong data to be written into the
      journal.  Fortunately, if we lose this race, the only time this will
      actually cause filesystem corruption is if there is a system crash or
      other unclean shutdown of the system before the next commit can take
      place.
      Signed-off-by: Ndingdinghua <dingdinghua85@gmail.com>
      Signed-off-by: N"Theodore Ts'o" <tytso@mit.edu>
      96577c43
  18. 17 7月, 2009 1 次提交
  19. 18 6月, 2009 1 次提交
  20. 14 7月, 2009 1 次提交
    • J
      jbd2: Fix a race between checkpointing code and journal_get_write_access() · f91d1d04
      Jan Kara 提交于
      The following race can happen:
      
       CPU1                          CPU2
                                     checkpointing code checks the buffer, adds
                                       it to an array for writeback
       do_get_write_access()
       ...
       lock_buffer()
       unlock_buffer()
                                     flush_batch() submits the buffer for IO
       __jbd2_journal_file_buffer()
      
      So a buffer under writeout is returned from
      do_get_write_access(). Since the filesystem code relies on the fact
      that journaled buffers cannot be written out, it does not take the
      buffer lock and so it can modify buffer while it is under
      writeout. That can lead to a filesystem corruption if we crash at the
      right moment.
      
      We fix the problem by clearing the buffer dirty bit under buffer_lock
      even if the buffer is on BJ_None list. Actually, we clear the dirty
      bit regardless the list the buffer is in and warn about the fact if
      the buffer is already journalled.
      
      Thanks for spotting the problem goes to dingdinghua <dingdinghua85@gmail.com>.
      Reported-by: Ndingdinghua <dingdinghua85@gmail.com>
      Signed-off-by: NJan Kara <jack@suse.cz>
      Signed-off-by: N"Theodore Ts'o" <tytso@mit.edu>
      f91d1d04
  21. 21 6月, 2009 1 次提交
  22. 09 6月, 2009 1 次提交
  23. 17 6月, 2009 1 次提交
  24. 14 4月, 2009 1 次提交
  25. 06 4月, 2009 1 次提交
  26. 28 3月, 2009 1 次提交
  27. 26 3月, 2009 1 次提交
  28. 11 2月, 2009 2 次提交
    • J
      jbd2: Avoid possible NULL dereference in jbd2_journal_begin_ordered_truncate() · 7f5aa215
      Jan Kara 提交于
      If we race with commit code setting i_transaction to NULL, we could
      possibly dereference it.  Proper locking requires the journal pointer
      (to access journal->j_list_lock), which we don't have.  So we have to
      change the prototype of the function so that filesystem passes us the
      journal pointer.  Also add a more detailed comment about why the
      function jbd2_journal_begin_ordered_truncate() does what it does and
      how it should be used.
      
      Thanks to Dan Carpenter <error27@gmail.com> for pointing to the
      suspitious code.
      Signed-off-by: NJan Kara <jack@suse.cz>
      Signed-off-by: N"Theodore Ts'o" <tytso@mit.edu>
      Acked-by: NJoel Becker <joel.becker@oracle.com>
      CC: linux-ext4@vger.kernel.org
      CC: ocfs2-devel@oss.oracle.com
      CC: mfasheh@suse.de
      CC: Dan Carpenter <error27@gmail.com>
      7f5aa215
    • J
      jbd2: Fix return value of jbd2_journal_start_commit() · c88ccea3
      Jan Kara 提交于
      The function jbd2_journal_start_commit() returns 1 if either a
      transaction is committing or the function has queued a transaction
      commit. But it returns 0 if we raced with somebody queueing the
      transaction commit as well. This resulted in ext4_sync_fs() not
      functioning correctly (description from Arthur Jones): 
      
         In the case of a data=ordered umount with pending long symlinks
         which are delayed due to a long list of other I/O on the backing
         block device, this causes the buffer associated with the long
         symlinks to not be moved to the inode dirty list in the second
         phase of fsync_super.  Then, before they can be dirtied again,
         kjournald exits, seeing the UMOUNT flag and the dirty pages are
         never written to the backing block device, causing long symlink
         corruption and exposing new or previously freed block data to
         userspace.
      
      This can be reproduced with a script created by Eric Sandeen
      <sandeen@redhat.com>:
      
              #!/bin/bash
      
              umount /mnt/test2
              mount /dev/sdb4 /mnt/test2
              rm -f /mnt/test2/*
              dd if=/dev/zero of=/mnt/test2/bigfile bs=1M count=512
              touch /mnt/test2/thisisveryveryveryveryveryveryveryveryveryveryveryveryveryveryveryverylongfilename
              ln -s /mnt/test2/thisisveryveryveryveryveryveryveryveryveryveryveryveryveryveryveryverylongfilename
              /mnt/test2/link
              umount /mnt/test2
              mount /dev/sdb4 /mnt/test2
              ls /mnt/test2/
      
      This patch fixes jbd2_journal_start_commit() to always return 1 when
      there's a transaction committing or queued for commit.
      Signed-off-by: NJan Kara <jack@suse.cz>
      Signed-off-by: N"Theodore Ts'o" <tytso@mit.edu>
      CC: Eric Sandeen <sandeen@redhat.com>
      CC: linux-ext4@vger.kernel.org
      c88ccea3
  29. 12 1月, 2009 1 次提交
    • S
      ext4: fix wrong use of do_div · c225aa57
      Simon Holm Thøgersen 提交于
      the following warning:
      
      fs/jbd2/journal.c: In function ‘jbd2_seq_info_show’:
      fs/jbd2/journal.c:850: warning: format ‘%lu’ expects type ‘long
      unsigned int’, but argument 3 has type ‘uint32_t’
      
      is caused by wrong usage of do_div that modifies the dividend in-place
      and returns the quotient. So not only would an incorrect value be
      displayed, but s->journal->j_average_commit_time would also be changed
      to a wrong value!
      
      Fix it by using div_u64 instead.
      Signed-off-by: NSimon Holm Thøgersen <odie@cs.aau.dk>
      Signed-off-by: N"Theodore Ts'o" <tytso@mit.edu>
      c225aa57
  30. 07 1月, 2009 1 次提交
  31. 06 1月, 2009 1 次提交
    • J
      jbd2: Add buffer triggers · e06c8227
      Joel Becker 提交于
      Filesystems often to do compute intensive operation on some
      metadata.  If this operation is repeated many times, it can be very
      expensive.  It would be much nicer if the operation could be performed
      once before a buffer goes to disk.
      
      This adds triggers to jbd2 buffer heads.  Just before writing a metadata
      buffer to the journal, jbd2 will optionally call a commit trigger associated
      with the buffer.  If the journal is aborted, an abort trigger will be
      called on any dirty buffers as they are dropped from pending
      transactions.
      
      ocfs2 will use this feature.
      
      Initially I tried to come up with a more generic trigger that could be
      used for non-buffer-related events like transaction completion.  It
      doesn't tie nicely, because the information a buffer trigger needs
      (specific to a journal_head) isn't the same as what a transaction
      trigger needs (specific to a tranaction_t or perhaps journal_t).  So I
      implemented a buffer set, with the understanding that
      journal/transaction wide triggers should be implemented separately.
      
      There is only one trigger set allowed per buffer.  I can't think of any
      reason to attach more than one set.  Contrast this with a journal or
      transaction in which multiple places may want to watch the entire
      transaction separately.
      
      The trigger sets are considered static allocation from the jbd2
      perspective.  ocfs2 will just have one trigger set per block type,
      setting the same set on every bh of the same type.
      Signed-off-by: NJoel Becker <joel.becker@oracle.com>
      Cc: "Theodore Ts'o" <tytso@mit.edu>
      Cc: <linux-ext4@vger.kernel.org>
      Signed-off-by: NMark Fasheh <mfasheh@suse.com>
      e06c8227
  32. 05 1月, 2009 1 次提交
  33. 04 1月, 2009 1 次提交
  34. 07 1月, 2009 1 次提交