On Thu, Nov 08, 2018 at 02:17:56PM -0800, Darrick J. Wong wrote: > On Thu, Nov 08, 2018 at 08:04:32PM +1100, Dave Chinner wrote: > > On Wed, Nov 07, 2018 at 05:38:43PM -0800, Darrick J. Wong wrote: > > @@ -1416,6 +1420,11 @@ do_copy_range(unsigned offset, unsigned length, unsigned dest) > > loff_t o1, o2; > > ssize_t nr; > > > > + offset -= offset % readbdy; > > + dest -= dest % writebdy; > > + if (o_direct) > > + length -= length % readbdy; > > Don't we want byte-granularity copies if we're doing buffered copies? Yes, just don't set -r/-w values when doing buffered IO. O_DIRECT requires the length to be aligned, too, but buffered IO doesn't, which is why the "if (o_direct)" case is there. Cheers, Dave. -- Dave Chinner david@xxxxxxxxxxxxx