ceph: invalidate dirty pages after forced umount
authorYan, Zheng <zyan@redhat.com>
Wed, 1 Jul 2015 09:03:23 +0000 (17:03 +0800)
committerIlya Dryomov <idryomov@gmail.com>
Tue, 8 Sep 2015 20:14:28 +0000 (23:14 +0300)
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 <zyan@redhat.com>
fs/ceph/addr.c

index 1594f2c590bd25bbb062eb0e1f50412fd58da3db..98933350331c47d362248a28fd539ad6bec507aa 100644 (file)
@@ -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)