]> git.apps.os.sepia.ceph.com Git - xfsprogs-dev.git/commit
xfs_copy: actually do directio writes to block devices
authorDarrick J. Wong <djwong@kernel.org>
Wed, 20 Dec 2023 16:53:43 +0000 (08:53 -0800)
committerDarrick J. Wong <djwong@kernel.org>
Fri, 22 Dec 2023 02:29:14 +0000 (18:29 -0800)
commit6ecc6712238c3ea5b574caf4a165ff20f5450e8b
tree04fd2213329949b6b4b76d51279f36cbe0f38f95
parent603850fe94cdb6a586eb75cb33bcb9e24e204b18
xfs_copy: actually do directio writes to block devices

Not sure why block device targets don't get O_DIRECT in !buffered mode,
but it's misleading when the copy completes instantly only to stall
forever due to fsync-on-close.  Adjust the "write last sector" code to
allocate a properly aligned buffer.

In removing the onstack buffer for EOD writes, this also corrects the
buffer being larger than necessary -- the old code declared an array of
32768 pointers, whereas all we really need is an aligned 32768-byte
buffer.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
copy/xfs_copy.c