diff options
author | Theodore Ts'o <tytso@mit.edu> | 2014-03-09 00:07:19 -0500 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2014-03-09 00:07:19 -0500 |
commit | d2eb0b998990abf51d6e1d3bf16a2637b920a660 (patch) | |
tree | 9493b41df7e513716f41fc10105b02193dcb5d9e | |
parent | d4e839d4a9dc31d0c229e616146b01e1ace56604 (diff) |
jbd2: check jh->b_transaction without taking j_list_lock
jh->b_transaction is adequately protected for reading by the
jbd_lock_bh_state(bh), so we don't need to take j_list_lock in
__journal_try_to_free_buffer().
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
-rw-r--r-- | fs/jbd2/transaction.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/jbd2/transaction.c b/fs/jbd2/transaction.c index 60bb365f54a5..78900a1252b2 100644 --- a/fs/jbd2/transaction.c +++ b/fs/jbd2/transaction.c | |||
@@ -1821,11 +1821,11 @@ __journal_try_to_free_buffer(journal_t *journal, struct buffer_head *bh) | |||
1821 | if (buffer_locked(bh) || buffer_dirty(bh)) | 1821 | if (buffer_locked(bh) || buffer_dirty(bh)) |
1822 | goto out; | 1822 | goto out; |
1823 | 1823 | ||
1824 | if (jh->b_next_transaction != NULL) | 1824 | if (jh->b_next_transaction != NULL || jh->b_transaction != NULL) |
1825 | goto out; | 1825 | goto out; |
1826 | 1826 | ||
1827 | spin_lock(&journal->j_list_lock); | 1827 | spin_lock(&journal->j_list_lock); |
1828 | if (jh->b_cp_transaction != NULL && jh->b_transaction == NULL) { | 1828 | if (jh->b_cp_transaction != NULL) { |
1829 | /* written-back checkpointed metadata buffer */ | 1829 | /* written-back checkpointed metadata buffer */ |
1830 | JBUFFER_TRACE(jh, "remove from checkpoint list"); | 1830 | JBUFFER_TRACE(jh, "remove from checkpoint list"); |
1831 | __jbd2_journal_remove_checkpoint(jh); | 1831 | __jbd2_journal_remove_checkpoint(jh); |