aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYan, Zheng <zyan@redhat.com>2017-05-23 05:18:53 -0400
committerIlya Dryomov <idryomov@gmail.com>2017-07-07 11:25:13 -0400
commitfa71fefb308532eb5b2e4b38d914d19fc836f73e (patch)
tree8345537a3273ce56adb274bb87c45ac3d071099d
parentf2b0c45f09796f87723a1225c919035457f72b7a (diff)
ceph: redirty page when writepage_nounlock() skips unwritable page
Ceph needs to flush dirty page in the order in which in which snap context they belong to. Dirty pages belong to older snap context should be flushed earlier. if writepage_nounlock() can not flush a page, it should redirty the page. Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: "Yan, Zheng" <zyan@redhat.com> Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
-rw-r--r--fs/ceph/addr.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/ceph/addr.c b/fs/ceph/addr.c
index 96f83a417944..8fde3b59e3a5 100644
--- a/fs/ceph/addr.c
+++ b/fs/ceph/addr.c
@@ -551,8 +551,9 @@ static int writepage_nounlock(struct page *page, struct writeback_control *wbc)
551 dout("writepage %p page %p snapc %p not writeable - noop\n", 551 dout("writepage %p page %p snapc %p not writeable - noop\n",
552 inode, page, snapc); 552 inode, page, snapc);
553 /* we should only noop if called by kswapd */ 553 /* we should only noop if called by kswapd */
554 WARN_ON((current->flags & PF_MEMALLOC) == 0); 554 WARN_ON(!(current->flags & PF_MEMALLOC));
555 ceph_put_snap_context(oldest); 555 ceph_put_snap_context(oldest);
556 redirty_page_for_writepage(wbc, page);
556 goto out; 557 goto out;
557 } 558 }
558 ceph_put_snap_context(oldest); 559 ceph_put_snap_context(oldest);