1. 11 11月, 2009 1 次提交
  2. 02 10月, 2009 1 次提交
  3. 30 9月, 2009 2 次提交
  4. 23 9月, 2009 1 次提交
  5. 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
  6. 17 7月, 2009 1 次提交
  7. 21 6月, 2009 1 次提交
  8. 09 6月, 2009 1 次提交
  9. 17 6月, 2009 1 次提交
  10. 11 2月, 2009 1 次提交
    • 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
  11. 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
  12. 07 1月, 2009 1 次提交
  13. 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
  14. 04 1月, 2009 1 次提交
  15. 07 1月, 2009 1 次提交
  16. 05 11月, 2008 1 次提交
  17. 04 1月, 2009 1 次提交
  18. 17 12月, 2008 1 次提交
  19. 03 11月, 2008 1 次提交
  20. 11 10月, 2008 1 次提交
    • H
      jbd2: fix error handling for checkpoint io · 44519faf
      Hidehiro Kawai 提交于
      When a checkpointing IO fails, current JBD2 code doesn't check the
      error and continue journaling.  This means latest metadata can be
      lost from both the journal and filesystem.
      
      This patch leaves the failed metadata blocks in the journal space
      and aborts journaling in the case of jbd2_log_do_checkpoint().
      To achieve this, we need to do:
      
      1. don't remove the failed buffer from the checkpoint list where in
         the case of __try_to_free_cp_buf() because it may be released or
         overwritten by a later transaction
      2. jbd2_log_do_checkpoint() is the last chance, remove the failed
         buffer from the checkpoint list and abort the journal
      3. when checkpointing fails, don't update the journal super block to
         prevent the journaled contents from being cleaned.  For safety,
         don't update j_tail and j_tail_sequence either
      4. when checkpointing fails, notify this error to the ext4 layer so
         that ext4 don't clear the needs_recovery flag, otherwise the
         journaled contents are ignored and cleaned in the recovery phase
      5. if the recovery fails, keep the needs_recovery flag
      6. prevent jbd2_cleanup_journal_tail() from being called between
         __jbd2_journal_drop_transaction() and jbd2_journal_abort()
         (a possible race issue between jbd2_log_do_checkpoint()s called by
         jbd2_journal_flush() and __jbd2_log_wait_for_space())
      Signed-off-by: NHidehiro Kawai <hidehiro.kawai.ez@hitachi.com>
      Signed-off-by: NTheodore Ts'o <tytso@mit.edu>
      44519faf
  21. 07 10月, 2008 1 次提交
  22. 17 9月, 2008 1 次提交
    • T
      jbd2: clean up how the journal device name is printed · 05496769
      Theodore Ts'o 提交于
      Calculate the journal device name once and stash it away in the
      journal_s structure.  This avoids needing to call bdevname()
      everywhere and reduces stack usage by not needing to allocate an
      on-stack buffer.  In addition, we eliminate the '/' that can appear in
      device names (e.g. "cciss/c0d0p9" --- see kernel bugzilla #11321) that
      can cause problems when creating proc directory names, and include the
      inode number to support ocfs2 which creates multiple journals with
      different inode numbers.
      Signed-off-by: N"Theodore Ts'o" <tytso@mit.edu>
      05496769
  23. 27 7月, 2008 1 次提交
  24. 12 7月, 2008 2 次提交
  25. 13 5月, 2008 1 次提交
  26. 29 4月, 2008 1 次提交
  27. 17 4月, 2008 1 次提交
  28. 30 4月, 2008 1 次提交
  29. 17 4月, 2008 2 次提交
  30. 31 3月, 2008 1 次提交
  31. 29 1月, 2008 3 次提交
    • M
      jbd2: Mark jbd2 slabs as SLAB_TEMPORARY · 77160957
      Mingming Cao 提交于
      This patch marks slab allocations by jbd2 as short-lived in support of
      Mel Gorman's "Group short-lived and reclaimable kernel allocations"
      patch.  (Ported from similar changes made to fs/jbd/journal.c and
      fs/jbd/revoke.c in Mel's patch.)
      
      Cc: Mel Gorman <mel@csn.ul.ie>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NMingming Cao <cmm@us.ibm.com>
      Signed-off-by: N"Theodore Ts'o" <tytso@mit.edu>
      77160957
    • G
      ext4: Add the journal checksum feature · 818d276c
      Girish Shilamkar 提交于
      The journal checksum feature adds two new flags i.e
      JBD2_FEATURE_INCOMPAT_ASYNC_COMMIT and JBD2_FEATURE_COMPAT_CHECKSUM.
      
      JBD2_FEATURE_CHECKSUM flag indicates that the commit block contains the
      checksum for the blocks described by the descriptor blocks.
      Due to checksums, writing of the commit record no longer needs to be
      synchronous. Now commit record can be sent to disk without waiting for
      descriptor blocks to be written to disk. This behavior is controlled
      using JBD2_FEATURE_ASYNC_COMMIT flag. Older kernels/e2fsck should not be
      able to recover the journal with _ASYNC_COMMIT hence it is made
      incompat.
      The commit header has been extended to hold the checksum along with the
      type of the checksum.
      
      For recovery in pass scan checksums are verified to ensure the sanity
      and completeness(in case of _ASYNC_COMMIT) of every transaction.
      Signed-off-by: NAndreas Dilger <adilger@clusterfs.com>
      Signed-off-by: NGirish Shilamkar <girish@clusterfs.com>
      Signed-off-by: NDave Kleikamp <shaggy@linux.vnet.ibm.com>
      Signed-off-by: NMingming Cao <cmm@us.ibm.com>
      818d276c
    • J
      jbd2: jbd2 stats through procfs · 8e85fb3f
      Johann Lombardi 提交于
      The patch below updates the jbd stats patch to 2.6.20/jbd2.
      The initial patch was posted by Alex Tomas in December 2005
      (http://marc.info/?l=linux-ext4&m=113538565128617&w=2).
      It provides statistics via procfs such as transaction lifetime and size.
      
      Sometimes, investigating performance problems, i find useful to have
      stats from jbd about transaction's lifetime, size, etc. here is a
      patch for review and inclusion probably.
      
      for example, stats after creation of 3M files in htree directory:
      
      [root@bob ~]# cat /proc/fs/jbd/sda/history
      R/C  tid   wait  run   lock  flush log   hndls  block inlog ctime write drop  close
      R    261   8260  2720  0     0     750   9892   8170  8187
      C    259                                                    750   0     4885  1
      R    262   20    2200  10    0     770   9836   8170  8187
      R    263   30    2200  10    0     3070  9812   8170  8187
      R    264   0     5000  10    0     1340  0      0     0
      C    261                                                    8240  3212  4957  0
      R    265   8260  1470  0     0     4640  9854   8170  8187
      R    266   0     5000  10    0     1460  0      0     0
      C    262                                                    8210  2989  4868  0
      R    267   8230  1490  10    0     4440  9875   8171  8188
      R    268   0     5000  10    0     1260  0      0     0
      C    263                                                    7710  2937  4908  0
      R    269   7730  1470  10    0     3330  9841   8170  8187
      R    270   0     5000  10    0     830   0      0     0
      C    265                                                    8140  3234  4898  0
      C    267                                                    720   0     4849  1
      R    271   8630  2740  20    0     740   9819   8170  8187
      C    269                                                    800   0     4214  1
      R    272   40    2170  10    0     830   9716   8170  8187
      R    273   40    2280  0     0     3530  9799   8170  8187
      R    274   0     5000  10    0     990   0      0     0
      
      
      where,
      
      R     - line for transaction's life from T_RUNNING to T_FINISHED
      C     - line for transaction's checkpointing
      tid   - transaction's id
      wait  - for how long we were waiting for new transaction to start
               (the longest period journal_start() took in this transaction)
      run   - real transaction's lifetime (from T_RUNNING to T_LOCKED
      lock  - how long we were waiting for all handles to close
               (time the transaction was in T_LOCKED)
      flush - how long it took to flush all data (data=ordered)
      log   - how long it took to write the transaction to the log
      hndls - how many handles got to the transaction
      block - how many blocks got to the transaction
      inlog - how many blocks are written to the log (block + descriptors)
      ctime - how long it took to checkpoint the transaction
      write - how many blocks have been written during checkpointing
      drop  - how many blocks have been dropped during checkpointing
      close - how many running transactions have been closed to checkpoint this one
      
      all times are in msec.
      
      
      [root@bob ~]# cat /proc/fs/jbd/sda/info
      280 transaction, each upto 8192 blocks
      average:
        1633ms waiting for transaction
        3616ms running transaction
        5ms transaction was being locked
        1ms flushing data (in ordered mode)
        1799ms logging transaction
        11781 handles per transaction
        5629 blocks per transaction
        5641 logged blocks per transaction
      Signed-off-by: NJohann Lombardi <johann.lombardi@bull.net>
      Signed-off-by: NMariusz Kozlowski <m.kozlowski@tuxland.pl>
      Signed-off-by: NMingming Cao <cmm@us.ibm.com>
      Signed-off-by: NEric Sandeen <sandeen@redhat.com>
      8e85fb3f
  32. 18 10月, 2007 4 次提交