From: Taesoo Kim Date: Fri, 20 Mar 2015 21:36:56 +0000 (-0400) Subject: ceph: properly release page upon error X-Git-Tag: v4.1-rc1~36^2~21 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c1d00b2d9c4fc821e33c5cdfbdbc32677cb0e2e0;p=platform%2Fkernel%2Flinux-exynos.git ceph: properly release page upon error When ceph_update_writeable_page fails (including -EAGAIN), it unlocks (w/ unlock_page) the page but does not 'release' (w/ page_cache_release) properly. Upon error, properly set *pagep to NULL, indicating an error. Signed-off-by: Taesoo Kim Signed-off-by: Yan, Zheng --- diff --git a/fs/ceph/addr.c b/fs/ceph/addr.c index fd5599d..e723482 100644 --- a/fs/ceph/addr.c +++ b/fs/ceph/addr.c @@ -1146,6 +1146,10 @@ static int ceph_write_begin(struct file *file, struct address_space *mapping, inode, page, (int)pos, (int)len); r = ceph_update_writeable_page(file, pos, len, page); + if (r < 0) + page_cache_release(page); + else + *pagep = page; } while (r == -EAGAIN); return r;