Re: [PATCH 2/2] xfs: fix stale data exposure problem when punch hole, collapse range or zero range across a delalloc extent

From: Darrick J. Wong
Date: Tue Jan 07 2020 - 13:18:13 EST


On Tue, Jan 07, 2020 at 10:09:44AM +0800, yukuai (C) wrote:
>
>
> On 2020/1/7 5:57, Darrick J. Wong wrote:
> > So your solution is to split the delalloc reservation to constrain the
> > allocation to the range that's being operated on?
> Yes, I'm trying to split delalloc reservation.
> >
> > If so, I think a better solution (at least from the perspective of
> > reducing fragmentation) would be to map the extent unwritten and force a
> > post-writeback conversion[1] but I got shot down for performance reasons
> > the last time I suggested that.
> I'm wondering if spliting delalloc reservation have the same performance
> issue.

Probably not, but OTOH will doing so (a) have a noticeable effect on
fragmentation, and (b) will the kernel code choke on two adjacent
delalloc extents that could be merged? (I think the answer is no since
we'll either complete the operation or the fs goes down...?)

--D

> Thanks!
> Yu Kuai
>