OSDN Git Service

fsdax: invalidate pages when CoW
authorShiyang Ruan <ruansy.fnst@fujitsu.com>
Thu, 1 Dec 2022 15:28:52 +0000 (15:28 +0000)
committerAndrew Morton <akpm@linux-foundation.org>
Mon, 12 Dec 2022 02:12:16 +0000 (18:12 -0800)
commitf80e1668888f34c0764822e74953c997daf2ccdb
tree736491b9ee73e4603e4795e716927e572b4961e6
parent169004265860327182ecf92297b25b6271e81e96
fsdax: invalidate pages when CoW

CoW changes the share state of a dax page, but the share count of the page
isn't updated.  The next time access this page, it should have been a
newly accessed, but old association exists.  So, we need to clear the
share state when CoW happens, in both dax_iomap_rw() and dax_zero_iter().

Link: https://lkml.kernel.org/r/1669908538-55-3-git-send-email-ruansy.fnst@fujitsu.com
Signed-off-by: Shiyang Ruan <ruansy.fnst@fujitsu.com>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Cc: Alistair Popple <apopple@nvidia.com>
Cc: Dan Williams <dan.j.williams@intel.com>
Cc: Dave Chinner <david@fromorbit.com>
Cc: Jason Gunthorpe <jgg@nvidia.com>
Cc: John Hubbard <jhubbard@nvidia.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
fs/dax.c