]> git.hungrycats.org Git - linux/commit
Btrfs: fix crash of btrfs_release_extent_buffer_page
authorLiu Bo <bo.li.liu@oracle.com>
Tue, 23 Sep 2014 14:22:33 +0000 (22:22 +0800)
committerZygo Blaxell <zblaxell@serenity.furryterror.org>
Wed, 3 Dec 2014 15:15:45 +0000 (10:15 -0500)
commite1f4bbcd5e0c41f35ece349a96de29d37f309a28
treeaa4065e3abf7d22501e5f1339efba6efb4409a48
parent667757d70251f094bf65698283482c2284adb37b
Btrfs: fix crash of btrfs_release_extent_buffer_page

This is actually inspired by Filipe's patch.  When write_one_eb() fails on
submit_extent_page(), it'll give up writing this eb and mark it with
EXTENT_BUFFER_IOERR.  So if it's not the last page that encounter the failure,
there are some left pages which remain DIRTY, and if a later COW on this eb
happens, ie. eb is COWed and freed, it'd run into BUG_ON in
btrfs_release_extent_buffer_page() for the DIRTY page, ie. BUG_ON(PageDirty(page));

This adds the missing clear_page_dirty_for_io() for the rest pages of eb.

Signed-off-by: Liu Bo <bo.li.liu@oracle.com>
Reviewed-by: Filipe Manana <fdmanana@suse.com>
Signed-off-by: Chris Mason <clm@fb.com>
(cherry picked from commit 8146502820231da924ca22d147cdcf733ac9a057)
fs/btrfs/extent_io.c