[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-block] [PULL 01/29] osdep: Retry SETLK upon EINTR
From: |
Kevin Wolf |
Subject: |
[Qemu-block] [PULL 01/29] osdep: Retry SETLK upon EINTR |
Date: |
Tue, 23 Jan 2018 15:01:33 +0100 |
From: Fam Zheng <address@hidden>
We could hit lock failure if there is a signal that makes fcntl return
-1 and errno set to EINTR. In this case we should retry.
Cc: address@hidden
Signed-off-by: Fam Zheng <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>
---
util/osdep.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/util/osdep.c b/util/osdep.c
index 1231f9f876..a73de0e1ba 100644
--- a/util/osdep.c
+++ b/util/osdep.c
@@ -244,7 +244,9 @@ static int qemu_lock_fcntl(int fd, int64_t start, int64_t
len, int fl_type)
.l_type = fl_type,
};
qemu_probe_lock_ops();
- ret = fcntl(fd, fcntl_op_setlk, &fl);
+ do {
+ ret = fcntl(fd, fcntl_op_setlk, &fl);
+ } while (ret == -1 && errno == EINTR);
return ret == -1 ? -errno : 0;
}
--
2.13.6
- [Qemu-block] [PULL 00/29] Block layer patches, Kevin Wolf, 2018/01/23
- [Qemu-block] [PULL 02/29] hw/block: Fix pin-based interrupt behaviour of NVMe, Kevin Wolf, 2018/01/23
- [Qemu-block] [PULL 05/29] qcow2: Repair unaligned preallocated zero clusters, Kevin Wolf, 2018/01/23
- [Qemu-block] [PULL 01/29] osdep: Retry SETLK upon EINTR,
Kevin Wolf <=
- [Qemu-block] [PULL 03/29] tests/.gitignore: Add test-bdrv-drain, Kevin Wolf, 2018/01/23
- [Qemu-block] [PULL 08/29] blockdev: Drop BD-{remove, insert}-medium's @device, Kevin Wolf, 2018/01/23
- [Qemu-block] [PULL 04/29] tests/qemu-iotests: adding savevm/loadvm with postcopy flag test, Kevin Wolf, 2018/01/23
- [Qemu-block] [PULL 07/29] tests/ahci: Switch tray and medium commands to @id, Kevin Wolf, 2018/01/23
- [Qemu-block] [PULL 06/29] iotests: Make BD-{remove, insert}-medium use @id, Kevin Wolf, 2018/01/23
- [Qemu-block] [PULL 12/29] qcow2: No persistent dirty bitmaps for compat=0.10, Kevin Wolf, 2018/01/23
- [Qemu-block] [PULL 10/29] qemu-iotests: Fix locking issue in 102, Kevin Wolf, 2018/01/23
- [Qemu-block] [PULL 15/29] iotests: Fix _img_info for backslashes, Kevin Wolf, 2018/01/23
- [Qemu-block] [PULL 13/29] block/qcow: Add blkdebug events, Kevin Wolf, 2018/01/23
- [Qemu-block] [PULL 09/29] blockdev: Mark BD-{remove, insert}-medium stable, Kevin Wolf, 2018/01/23