On Fri, Nov 09, 2018 at 07:22:18AM -0800, Christoph Hellwig wrote: > > + unsigned bsize = i_blocksize(mapping->host); > > > > /* > > * Refuse to write pages out if we are called from reclaim context. > > @@ -922,6 +923,19 @@ xfs_vm_writepages( > > if (WARN_ON_ONCE(current->flags & PF_MEMALLOC_NOFS)) > > return 0; > > > > + /* > > + * If the block size is larger than page size, extent the incoming write > > + * request to fsb granularity and alignment. This is a requirement for > > + * data integrity operations and it doesn't hurt for other write > > + * operations, so do it unconditionally. > > + */ > > + if (wbc->range_start) > > + wbc->range_start = round_down(wbc->range_start, bsize); > > + if (wbc->range_end != LLONG_MAX) > > + wbc->range_end = round_up(wbc->range_end, bsize); > > + if (wbc->nr_to_write < wbc->range_end - wbc->range_start) > > + wbc->nr_to_write = round_up(wbc->nr_to_write, bsize); > > This looks fine to me, but I'd be much more comfortable it we had > it in the common writeback code instead of inside XFS. Where in the common code? there's quite a few places that can call ->writepages... Cheers, Dave. -- Dave Chinner david@xxxxxxxxxxxxx