Commit e3380360 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] JBD: journal_unmap_buffer race fix

We need to check that buffer is still journalled _after_ taking the right
locks.
parent 4b3044b0
......@@ -1756,6 +1756,14 @@ static int journal_unmap_buffer(journal_t *journal, struct buffer_head *bh)
spin_lock(&journal->j_state_lock);
jbd_lock_bh_state(bh);
spin_lock(&journal->j_list_lock);
/*
* Now we have the locks, check again to see whether kjournald has
* taken the buffer off the transaction.
*/
if (!buffer_jbd(bh))
goto zap_buffer;
jh = bh2jh(bh);
transaction = jh->b_transaction;
if (transaction == NULL) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment