Skip to contentSkip to conversation

file-posix: Handle EINTR in preallocation=full write

PATCH Applied Fam Zheng 2 participants 3 messages Jul 27, 2018 Block layer

lore
Share & tools
lore

Fam Zheng

author
#0 lore raw

PATCH 1/1 file-posix: Handle EINTR in preallocation=full write

---
 block/file-posix.c | 3 +++
 1 file changed, 3 insertions(+)
block/file-posix.c +3 -0
index ad299beb38..928b863ced 100644
@@ -1646,6 +1646,9 @@ static int handle_aiocb_truncate(RawPosixAIOData *aiocb)
             num = MIN(left, 65536);
             result = write(fd, buf, num);
             if (result < 0) {
+                if (errno == EINTR) {
+                    continue;
+                }
                 result = -errno;
                 error_setg_errno(errp, -result,
                                  "Could not write zeros for preallocation");
Signature · 1 line
2.17.1