On Fri, Aug 16, 2019 at 09:11:34AM -0700, Darrick J. Wong wrote: > From: Darrick J. Wong <darrick.wong@xxxxxxxxxx> > > While trawling through the dedupe file comparison code trying to fix > page deadlocking problems, Dave Chinner noticed that the reflink code > only takes shared IOLOCK/MMAPLOCKs on the source file. Because > page_mkwrite and directio writes do not take the EXCL versions of those > locks, this means that reflink can race with writer processes. > > For pure remapping this can lead to undefined behavior and file > corruption; for dedupe this means that we cannot be sure that the > contents are identical when we decide to go ahead with the remapping. > > Signed-off-by: Darrick J. Wong <darrick.wong@xxxxxxxxxx> Looks good, Reviewed-by: Christoph Hellwig <hch@xxxxxx>