On Sat, Apr 01, 2017 at 07:21:08PM +0200, Greg KH wrote: > On Sat, Apr 01, 2017 at 08:34:58AM +0200, Christoph Hellwig wrote: > > commit 54a4ef8af4e0dc5c983d17fcb9cf5fd25666d94e upstream. > > > > We currently fall back from direct to buffered writes if we detect a > > remaining shared extent in the iomap_begin callback. But by the time > > iomap_begin is called for the potentially unaligned end block we might > > have already written most of the data to disk, which we'd now write > > again using buffered I/O. To avoid this reject all writes to reflinked > > files before starting I/O so that we are guaranteed to only write the > > data once. > > > > The alternative would be to unshare the unaligned start and/or end block > > before doing the I/O. I think that's doable, and will actually be > > required to support reflinks on DAX file system. But it will take a > > little more time and I'd rather get rid of the double write ASAP. > > > > Signed-off-by: Christoph Hellwig <hch@xxxxxx> > > Reviewed-by: Brian Foster <bfoster@xxxxxxxxxx> > > Reviewed-by: Darrick J. Wong <darrick.wong@xxxxxxxxxx> > > Signed-off-by: Darrick J. Wong <darrick.wong@xxxxxxxxxx> > > Any specific reason you don't want this one in 4.9 as well? Nevermind, it's there, missed it, my fault... greg k-h