ceph: only invalidate page after clearing dirty bit

In writepages, we can end up invalidating the page if we find it to be
beyond the EOF. That occurs before the dirty bit is cleared for the page
and leaves the client with a dirty page that does not have a
ceph_snap_context associated with it.

When next we try to dirty the page, the client then trips over a BUG_ON
in ceph_set_page_dirty. Fix this by moving the check for this issue and
invalidation after the point where the dirty bit is cleared.

URL: http://tracker.ceph.com/issues/40862
Signed-off-by: Jeff Layton <jlayton@kernel.org>
1 file changed