From: ChangLimin <changlm@chinatelecom.cn>
To: qemu-block <qemu-block@nongnu.org>
Cc: kwolf <kwolf@redhat.com>, qemu-devel <qemu-devel@nongnu.org>,
mreitz <mreitz@redhat.com>
Subject: [PATCH] file-posix: allow -EBUSY errors during write zeros on block
Date: Tue, 2 Mar 2021 09:56:42 +0800 [thread overview]
Message-ID: <2021030209564214018344@chinatelecom.cn> (raw)
After Linux 5.10, write zeros to a multipath device using
ioctl(fd, BLKZEROOUT, range) with cache none or directsync will return EBUSY.
Similar to handle_aiocb_write_zeroes_unmap, handle_aiocb_write_zeroes_block
allow -EBUSY errors during ioctl(fd, BLKZEROOUT, range).
Reference commit in Linux 5.10:
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=384d87ef2c954fc58e6c5fd8253e4a1984f5fe02
Signed-off-by: ChangLimin <changlm@chinatelecom.cn>
---
block/file-posix.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/block/file-posix.c b/block/file-posix.c
index 05079b40ca..3e60c96214 100644
--- a/block/file-posix.c
+++ b/block/file-posix.c
@@ -1629,8 +1629,13 @@ static ssize_t handle_aiocb_write_zeroes_block(RawPosixAIOData *aiocb)
} while (errno == EINTR);
ret = translate_err(-errno);
- if (ret == -ENOTSUP) {
+ switch (ret) {
+ case -ENOTSUP:
+ case -EINVAL:
+ case -EBUSY:
s->has_write_zeroes = false;
+ return -ENOTSUP;
+ break;
}
}
#endif
--
2.27.0
next reply other threads:[~2021-03-02 2:08 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-02 1:56 ChangLimin [this message]
2021-03-02 14:10 ` [PATCH] file-posix: allow -EBUSY errors during write zeros on block Kevin Wolf
2021-03-02 16:40 ` Nir Soffer
2021-03-04 0:14 ` ChangLimin
2021-03-03 3:24 ` [PATCH V2] file-posix: allow -EBUSY -EINVAL " ChangLimin
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=2021030209564214018344@chinatelecom.cn \
--to=changlm@chinatelecom.cn \
--cc=kwolf@redhat.com \
--cc=mreitz@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@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).