]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-client.git/commit
ceph: invalidate pages when doing direct/sync writes
authorLuís Henriques <lhenriques@suse.de>
Thu, 7 Apr 2022 15:15:21 +0000 (16:15 +0100)
committerJeff Layton <jlayton@kernel.org>
Tue, 31 May 2022 15:50:02 +0000 (11:50 -0400)
commit06048c5b83fb7a1b064a755423c0ac2225e78e80
treeca9e86a5086ed9416788381275d7f08a34705880
parentfbeb9efc6aa0e8c42e2329510b1d36f70fccbd28
ceph: invalidate pages when doing direct/sync writes

When doing a direct/sync write, we need to invalidate the page cache in
the range being written to. If we don't do this, the cache will include
invalid data as we just did a write that avoided the page cache.

In the event that invalidation fails, just ignore the error. That likely
just means that we raced with another task doing a buffered write, in
which case we want to leave the page intact anyway.

[ jlayton: minor comment update ]

Signed-off-by: Luís Henriques <lhenriques@suse.de>
Reviewed-by: Xiubo Li <xiubli@redhat.com>
Signed-off-by: Jeff Layton <jlayton@kernel.org>
fs/ceph/file.c