]> git.baikalelectronics.ru Git - kernel.git/commit
ext4: Fix buffer head reference leak in no-journal mode
authorCurt Wohlgemuth <curtw@google.com>
Mon, 13 Jul 2009 13:07:20 +0000 (09:07 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Mon, 13 Jul 2009 13:07:20 +0000 (09:07 -0400)
commitc01e6361617d631d8bb0f0df33bc12249a16b55e
tree922408d70d388925f0113998649d56da475deff4
parentc6ccce8b8d6cecb7af91cadee8e33f2c82b66a57
ext4: Fix buffer head reference leak in no-journal mode

We found a problem with buffer head reference leaks when using an ext4
partition without a journal.  In particular, calls to ext4_forget() would
not to a brelse() on the input buffer head, which will cause pages they
belong to to not be reclaimable.

Further investigation showed that all places where ext4_journal_forget() and
ext4_journal_revoke() are called are subject to the same problem.  The patch
below changes __ext4_journal_forget/__ext4_journal_revoke to do an explicit
release of the buffer head when the journal handle isn't valid.

Signed-off-by: Curt Wohlgemuth <curtw@google.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
fs/ext4/ext4_jbd2.c
fs/ext4/ext4_jbd2.h
fs/ext4/inode.c