Re: [PATCH 2/3] xfs: go straight to real allocations for direct I/O COW writes

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Jan 24, 2017 at 12:43:18PM -0500, Brian Foster wrote:
> Hmm, that's not what I'm seeing (not that it really matters, but I'm
> curious if I'm missing something):

Yeah, I can reproduce this on mainline.  Turns out the it was done
by the align call in xfs_bmap_btalloc that even my before run had
removed.

Took me some time to spin my head around this.

Btw, I think we have a nasty race in the current DIO code that might
expose stale data, but this is just the same kind of head spinning
exercise for now:

Thread 1 writes a range from B to c

                    B --------- C

a little later thread 2 writes from A to B

        A --------- B

but the code preallocates beyond B into the range where thread
1 has just written, but ->end_io hasn't been called yet.
But once ->end_io is called thread 2 has already allocated
up to the extent size hint into the write range of thread 1,
so the end_io handler will splice the unintialized blocks from
that preallocation back into the file right after B.
--
To unsubscribe from this list: send the line "unsubscribe linux-xfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [XFS Filesystem Development (older mail)]     [Linux Filesystem Development]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux RAID]     [Linux SCSI]


  Powered by Linux