[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [Qemu-block] [PATCH 1/2] block/file-posix: Reduce xfsct
From: |
John Snow |
Subject: |
Re: [Qemu-devel] [Qemu-block] [PATCH 1/2] block/file-posix: Reduce xfsctl() use |
Date: |
Wed, 28 Aug 2019 16:17:12 -0400 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 |
On 8/23/19 9:03 AM, Max Reitz wrote:
> This patch removes xfs_write_zeroes() and xfs_discard(). Both functions
> have been added just before the same feature was present through
> fallocate():
>
> - fallocate() has supported PUNCH_HOLE for XFS since Linux 2.6.38 (March
> 2011); xfs_discard() was added in December 2010.
>
> - fallocate() has supported ZERO_RANGE for XFS since Linux 3.15 (June
> 2014); xfs_write_zeroes() was added in November 2013.
>
> Nowadays, all systems that qemu runs on should support both fallocate()
> features (RHEL 7's kernel does).
>
> xfsctl() is still useful for getting the request alignment for O_DIRECT,
> so this patch does not remove our dependency on it completely.
>
> Note that xfs_write_zeroes() had a bug: It calls ftruncate() when the
> file is shorter than the specified range (because ZERO_RANGE does not
> increase the file length). ftruncate() may yield and then discard data
> that parallel write requests have written past the EOF in the meantime.
> Dropping the function altogether fixes the bug.
>
And I assume getting rid of discard is just then simply convenient, so
why not.
> Suggested-by: Paolo Bonzini <address@hidden>
> Fixes: 50ba5b2d994853b38fed10e0841b119da0f8b8e5
> Reported-by: Lukáš Doktor <address@hidden>
> Cc: address@hidden
> Signed-off-by: Max Reitz <address@hidden>
Tested-by: John Snow <address@hidden>
Reviewed-by: John Snow <address@hidden>