Jan Kara 057ba5b245 ceph: Fix race between hole punch and page fault
Ceph has a following race between hole punching and page fault:

CPU1                                  CPU2
ceph_fallocate()
  ...
  ceph_zero_pagecache_range()
                                      ceph_filemap_fault()
                                        faults in page in the range being
                                        punched
  ceph_zero_objects()

And now we have a page in punched range with invalid data. Fix the
problem by using mapping->invalidate_lock similarly to other
filesystems. Note that using invalidate_lock also fixes a similar race
wrt ->readpage().

CC: Jeff Layton <jlayton@kernel.org>
CC: ceph-devel@vger.kernel.org
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Jan Kara <jack@suse.cz>
2021-07-13 14:29:01 +02:00
..
2021-01-24 14:27:20 +01:00
2021-06-29 00:15:52 +02:00
2021-06-29 00:15:51 +02:00
2021-06-29 00:15:52 +02:00
2020-06-01 13:22:51 +02:00
2021-06-29 00:15:51 +02:00
2021-06-29 00:15:52 +02:00
2021-06-29 00:15:52 +02:00
2021-06-29 00:15:52 +02:00