[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 23/28] file-posix: handle EINTR during ioctl
From: |
Paolo Bonzini |
Subject: |
[PULL 23/28] file-posix: handle EINTR during ioctl |
Date: |
Fri, 25 Jun 2021 16:18:17 +0200 |
Similar to other handle_aiocb_* functions, handle_aiocb_ioctl needs to cater
for the possibility that ioctl is interrupted by a signal. Otherwise, the
I/O is incorrectly reported as a failure to the guest.
Reported-by: Gordon Watson <gwatson@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
block/file-posix.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/block/file-posix.c b/block/file-posix.c
index 74b8216077..a26eab0ac3 100644
--- a/block/file-posix.c
+++ b/block/file-posix.c
@@ -1347,7 +1347,9 @@ static int handle_aiocb_ioctl(void *opaque)
RawPosixAIOData *aiocb = opaque;
int ret;
- ret = ioctl(aiocb->aio_fildes, aiocb->ioctl.cmd, aiocb->ioctl.buf);
+ do {
+ ret = ioctl(aiocb->aio_fildes, aiocb->ioctl.cmd, aiocb->ioctl.buf);
+ } while (ret == -1 && errno == EINTR);
if (ret == -1) {
return -errno;
}
--
2.31.1
- [PULL 14/28] scsi-generic: pass max_segments via max_iov field in BlockLimits, (continued)
- [PULL 14/28] scsi-generic: pass max_segments via max_iov field in BlockLimits, Paolo Bonzini, 2021/06/25
- [PULL 16/28] block-backend: align max_transfer to request alignment, Paolo Bonzini, 2021/06/25
- [PULL 15/28] osdep: provide ROUND_DOWN macro, Paolo Bonzini, 2021/06/25
- [PULL 17/28] block: add max_hw_transfer to BlockLimits, Paolo Bonzini, 2021/06/25
- [PULL 18/28] file-posix: try BLKSECTGET on block devices too, do not round to power of 2, Paolo Bonzini, 2021/06/25
- [PULL 19/28] block: feature detection for host block support, Paolo Bonzini, 2021/06/25
- [PULL 21/28] block: try BSD disk size ioctls one after another, Paolo Bonzini, 2021/06/25
- [PULL 20/28] block: check for sys/disk.h, Paolo Bonzini, 2021/06/25
- [PULL 22/28] block: detect DKIOCGETBLOCKCOUNT/SIZE before use, Paolo Bonzini, 2021/06/25
- [PULL 23/28] file-posix: handle EINTR during ioctl,
Paolo Bonzini <=
- [PULL 25/28] machine: move common smp_parse code to caller, Paolo Bonzini, 2021/06/25
- [PULL 26/28] machine: add error propagation to mc->smp_parse, Paolo Bonzini, 2021/06/25
- [PULL 24/28] machine: move dies from X86MachineState to CpuTopology, Paolo Bonzini, 2021/06/25
- [PULL 27/28] machine: pass QAPI struct to mc->smp_parse, Paolo Bonzini, 2021/06/25
- [PULL 28/28] machine: reject -smp dies!=1 for non-PC machines, Paolo Bonzini, 2021/06/25
- Re: [PULL v2 00/28] Misc (including block file-posix) for 2021-06-23, Peter Maydell, 2021/06/29