From: John Snow <jsnow@redhat.com>
To: Max Reitz <mreitz@redhat.com>, qemu-block@nongnu.org
Cc: "Lukáš Doktor" <ldoktor@redhat.com>,
"Kevin Wolf" <kwolf@redhat.com>,
"Paolo Bonzini" <pbonzini@redhat.com>,
qemu-stable@nongnu.org, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [Qemu-block] [PATCH 1/2] block/file-posix: Reduce xfsctl() use
Date: Wed, 28 Aug 2019 16:17:12 -0400 [thread overview]
Message-ID: <04c875e6-a468-fa57-3cb0-5f9782680834@redhat.com> (raw)
In-Reply-To: <20190823130341.21550-2-mreitz@redhat.com>
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 <pbonzini@redhat.com>
> Fixes: 50ba5b2d994853b38fed10e0841b119da0f8b8e5
> Reported-by: Lukáš Doktor <ldoktor@redhat.com>
> Cc: qemu-stable@nongnu.org
> Signed-off-by: Max Reitz <mreitz@redhat.com>
Tested-by: John Snow <jsnow@redhat.com>
Reviewed-by: John Snow <jsnow@redhat.com>
next prev parent reply other threads:[~2019-08-28 20:41 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-08-23 13:03 [Qemu-devel] [PATCH 0/2] block/file-posix: Reduce xfsctl() use Max Reitz
2019-08-23 13:03 ` [Qemu-devel] [PATCH 1/2] " Max Reitz
2019-08-28 20:17 ` John Snow [this message]
2019-08-23 13:03 ` [Qemu-devel] [PATCH 2/2] iotests: Test reverse sub-cluster qcow2 writes Max Reitz
2019-08-28 20:18 ` [Qemu-devel] [Qemu-block] " John Snow
2019-08-28 9:34 ` [Qemu-devel] [Qemu-block] [PATCH 0/2] block/file-posix: Reduce xfsctl() use Stefano Garzarella
2019-09-02 13:17 ` [Qemu-devel] " Kevin Wolf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=04c875e6-a468-fa57-3cb0-5f9782680834@redhat.com \
--to=jsnow@redhat.com \
--cc=kwolf@redhat.com \
--cc=ldoktor@redhat.com \
--cc=mreitz@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=qemu-stable@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).