Skip to content

Commit

Permalink
ceph: invalidate dirty pages after forced umount
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Yan, Zheng authored and Ilya Dryomov committed Sep 8, 2015
1 parent 48fec5d commit a341d4d
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions fs/ceph/addr.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit a341d4d

Please sign in to comment.