Re: LTP write03 writev07 xfs failures

From: Christoph Hellwig
Date: Tue Feb 28 2017 - 09:06:02 EST


On Mon, Feb 27, 2017 at 03:13:35PM -0500, Brian Foster wrote:
> After playing around a bit, I don't think using i_size is the right
> approach either. It just exacerbates the original problem on buffered
> writes into sparse files. We can end up leaving around however many
> delalloc blocks we've allocated.
>
> I think we need a way to differentiate preexisting (previously written)
> delalloc blocks from those allocated and unused by the current write. We
> might be able to do that by looking at the pagecache, but I think that
> means looking at the buffer state to make sure we handle sub-page block
> sizes correctly. I.e., make *_iomap_end_delalloc() punch out all
> delalloc blocks in the non-written range that are either not page backed
> or not dirty+delalloc buffer backed. Hm?

That sounds ugly, but right off my mind I see no other way. I'll need
to take a look at what the old pre-iomap code did there, as I think
none of these issues happened there.