Skip to content

Commit

Permalink
ceph: clear page dirty before invalidate page
Browse files Browse the repository at this point in the history
clear_page_dirty_for_io(page) before mapping->a_ops->invalidatepage().
invalidatepage() clears page's private flag, if dirty flag is not
cleared, the page may cause BUG_ON failure in ceph_set_page_dirty().

Cc: [email protected]
Link: https://tracker.ceph.com/issues/40862
Signed-off-by: Erqi Chen <[email protected]>
Reviewed-by: Jeff Layton <[email protected]>
Signed-off-by: Ilya Dryomov <[email protected]>
  • Loading branch information
Erqi Chen authored and idryomov committed Aug 22, 2019
1 parent af8a85a commit c95f1c5
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions fs/ceph/addr.c
Original file line number Diff line number Diff line change
Expand Up @@ -913,8 +913,9 @@ static int ceph_writepages_start(struct address_space *mapping,
if (page_offset(page) >= ceph_wbc.i_size) {
dout("%p page eof %llu\n",
page, ceph_wbc.i_size);
if (ceph_wbc.size_stable ||
page_offset(page) >= i_size_read(inode))
if ((ceph_wbc.size_stable ||
page_offset(page) >= i_size_read(inode)) &&
clear_page_dirty_for_io(page))
mapping->a_ops->invalidatepage(page,
0, PAGE_SIZE);
unlock_page(page);
Expand Down

0 comments on commit c95f1c5

Please sign in to comment.