]> git.karo-electronics.de Git - karo-tx-linux.git/commit
ext4: make sure directory and symlink blocks are revoked
authorTheodore Ts'o <tytso@mit.edu>
Mon, 23 Nov 2009 12:17:34 +0000 (07:17 -0500)
committerGreg Kroah-Hartman <gregkh@suse.de>
Mon, 14 Dec 2009 17:44:54 +0000 (09:44 -0800)
commit0f9036c7eed145cdd8c8ed9e899c61f499278259
tree274a229cb71925fd0100ee2a145a1dc8ca6092a8
parent21a4b3aaa2180ca6748446c4b06e91f3da244dca
ext4: make sure directory and symlink blocks are revoked

(cherry picked from commit 50689696867d95b38d9c7be640a311494a04fb86)

When an inode gets unlinked, the functions ext4_clear_blocks() and
ext4_remove_blocks() call ext4_forget() for all the buffer heads
corresponding to the deleted inode's data blocks.  If the inode is a
directory or a symlink, the is_metadata parameter must be non-zero so
ext4_forget() will revoke them via jbd2_journal_revoke().  Otherwise,
if these blocks are reused for a data file, and the system crashes
before a journal checkpoint, the journal replay could end up
corrupting these data blocks.

Thanks to Curt Wohlgemuth for pointing out potential problems in this
area.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
fs/ext4/extents.c
fs/ext4/inode.c