From: Yan, Zheng Date: Wed, 1 Jul 2015 09:03:23 +0000 (+0800) Subject: ceph: invalidate dirty pages after forced umount X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=a341d4df87487ae68189e0be869c39a2b0cb9aaa;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git ceph: invalidate dirty pages after forced umount After forced umount, ceph_writepages_start() skips flushing dirty pages. To make sure inode's reference count get dropped to zero, we need to invalidate dirty pages. Signed-off-by: Yan, Zheng --- diff --git a/fs/ceph/addr.c b/fs/ceph/addr.c index 1594f2c590bd..98933350331c 100644 --- a/fs/ceph/addr.c +++ b/fs/ceph/addr.c @@ -719,6 +719,8 @@ static int ceph_writepages_start(struct address_space *mapping, if (ACCESS_ONCE(fsc->mount_state) == CEPH_MOUNT_SHUTDOWN) { pr_warn("writepage_start %p on forced umount\n", inode); + truncate_pagecache(inode, 0); + mapping_set_error(mapping, -EIO); return -EIO; /* we're in a forced umount, don't write! */ } if (fsc->mount_options->wsize && fsc->mount_options->wsize < wsize)