summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorErqi Chen <chenerqi@gmail.com>2019-07-24 10:26:09 +0800
committerIlya Dryomov <idryomov@gmail.com>2019-08-22 10:47:41 +0200
commitc95f1c5f436badb9bb87e9b30fd573f6b3d59423 (patch)
tree368586876392f1780d9af7335c7edfec08015d67
parentaf8a85a41734f37b67ba8ce69d56b685bee4ac48 (diff)
downloadlinux-c95f1c5f436badb9bb87e9b30fd573f6b3d59423.tar.gz
linux-c95f1c5f436badb9bb87e9b30fd573f6b3d59423.tar.bz2
linux-c95f1c5f436badb9bb87e9b30fd573f6b3d59423.zip
ceph: clear page dirty before invalidate page
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: stable@vger.kernel.org Link: https://tracker.ceph.com/issues/40862 Signed-off-by: Erqi Chen <chenerqi@gmail.com> Reviewed-by: Jeff Layton <jlayton@kernel.org> Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
-rw-r--r--fs/ceph/addr.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/fs/ceph/addr.c b/fs/ceph/addr.c
index e078cc55b989..b3c8b886bf64 100644
--- a/fs/ceph/addr.c
+++ b/fs/ceph/addr.c
@@ -913,8 +913,9 @@ get_more_pages:
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);