Re: [PATCH RFC 06/10] xfs: iomap CoW-based atomic write support

John Garry
2025-02-07T11:48:36Z

On 06/02/2025 21:44, Darrick J. Wong wrote:
>>> What is this checking? That something else already created a mapping in
>>> the COW fork, so we want to bail out to get rid of it?
>> I want to check if some data is shared. In that case, we should unshare.
> Why is it necessary to unshare? Userspace gave us a buffer of new
> contents, and we're already prepared to write that out of place and
> remap it.

fine, as long as the remap does what we need, then I won't bother with
this explicit unshare.

>
>> And I am not sure if that check is sufficient.
>>
>> On the buffered write path, we may have something in a CoW fork - in that
>> case it should be flushed, right?
> Flushed against what? Concurrent writeback or something? The directio
> setup should have flushed dirty pagecache, so the only things left in
> the COW fork are speculative preallocations. (IOWs, I don't understand
> what needs to be flushed or why.)

ah, ok, as long as DIO would have flushed dirty relevant pagecache, then
we should be good.

Cheers,
John