diff --git a/fs/btrfs/file.c b/fs/btrfs/file.c index 97fbe939c050dc7d523baeaed960741c053cbf0d..bfb620ead295dc808fdb27c962b1da962cc50b20 100644 --- a/fs/btrfs/file.c +++ b/fs/btrfs/file.c @@ -1136,7 +1136,8 @@ static noinline int prepare_pages(struct btrfs_root *root, struct file *file, GFP_NOFS); } for (i = 0; i < num_pages; i++) { - clear_page_dirty_for_io(pages[i]); + if (clear_page_dirty_for_io(pages[i])) + account_page_redirty(pages[i]); set_page_extent_mapped(pages[i]); WARN_ON(!PageLocked(pages[i])); }