From: Yan, Zheng Date: Tue, 23 May 2017 09:18:53 +0000 (+0800) Subject: ceph: redirty page when writepage_nounlock() skips unwritable page X-Git-Tag: v4.14-rc1~497^2~40 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=fa71fefb308532eb5b2e4b38d914d19fc836f73e;p=platform%2Fkernel%2Flinux-rpi.git 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 Signed-off-by: "Yan, Zheng" Signed-off-by: Ilya Dryomov --- diff --git a/fs/ceph/addr.c b/fs/ceph/addr.c index 96f83a4..8fde3b5 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) dout("writepage %p page %p snapc %p not writeable - noop\n", inode, page, snapc); /* we should only noop if called by kswapd */ - WARN_ON((current->flags & PF_MEMALLOC) == 0); + WARN_ON(!(current->flags & PF_MEMALLOC)); ceph_put_snap_context(oldest); + redirty_page_for_writepage(wbc, page); goto out; } ceph_put_snap_context(oldest);