Commit 508fc350 authored by Andrew Morton's avatar Andrew Morton Committed by Greg Kroah-Hartman

[PATCH] ext3: fix memory leak

We need to unconditionally brelse() the buffer in there, because
journal_remove_journal_head() leaves a ref behind.

release_buffer_page() does that.  Call it all the time because we can usually
strip the buffers and free the page even if it was not marked buffer_freed().

Mainly affects data=journal mode
parent 30276fd6
......@@ -727,9 +727,8 @@ void journal_commit_transaction(journal_t *journal)
__journal_unfile_buffer(jh);
jh->b_transaction = 0;
jbd_unlock_bh_state(bh);
journal_remove_journal_head(bh);
if (buffer_freed(bh))
release_buffer_page(bh);
journal_remove_journal_head(bh); /* needs a brelse */
release_buffer_page(bh);
}
spin_unlock(&journal->j_list_lock);
}
......
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