On Mon, Nov 26, 2018 at 03:23:37PM -0800, Hugh Dickins wrote: > VM_BUG_ON(index != xas.xa_index); > if (!page) { > + /* > + * Stop if extent has been truncated or hole-punched, > + * and is now completely empty. > + */ > + if (index == start) { > + if (!xas_next_entry(&xas, end - 1)) { > + result = SCAN_TRUNCATED; > + break; > + } > + xas_set(&xas, index); > + } > if (!shmem_charge(mapping->host, 1)) { Reviewed-by: Matthew Wilcox <willy@xxxxxxxxxxxxx> I'd use xas_find() directly here; I don't think it warrants the inlined version of xas_next_entry(). But I'm happy either way.