1
The following changes since commit d47a851caeda96d5979bf48d4bae6a87784ad91d:
1
The following changes since commit 3521ade3510eb5cefb2e27a101667f25dad89935:
2
2
3
Merge remote-tracking branch 'remotes/juanquintela/tags/migration/20170601' into staging (2017-06-02 14:07:53 +0100)
3
Merge remote-tracking branch 'remotes/thuth-gitlab/tags/pull-request-2021-07-29' into staging (2021-07-29 13:17:20 +0100)
4
4
5
are available in the git repository at:
5
are available in the Git repository at:
6
6
7
git://github.com/codyprime/qemu-kvm-jtc.git tags/block-pull-request
7
https://gitlab.com/stefanha/qemu.git tags/block-pull-request
8
8
9
for you to fetch changes up to df3a429ae82c0f45becdfab105617701d75e0f05:
9
for you to fetch changes up to cc8eecd7f105a1dff5876adeb238a14696061a4a:
10
10
11
gluster: add support for PREALLOC_MODE_FALLOC (2017-06-02 10:51:47 -0400)
11
MAINTAINERS: Added myself as a reviewer for the NVMe Block Driver (2021-07-29 17:17:34 +0100)
12
12
13
----------------------------------------------------------------
13
----------------------------------------------------------------
14
Gluster patch(es)
14
Pull request
15
16
The main fix here is for io_uring. Spurious -EAGAIN errors can happen and the
17
request needs to be resubmitted.
18
19
The MAINTAINERS changes carry no risk and we might as well include them in QEMU
20
6.1.
21
15
----------------------------------------------------------------
22
----------------------------------------------------------------
16
23
17
Niels de Vos (1):
24
Fabian Ebner (1):
18
gluster: add support for PREALLOC_MODE_FALLOC
25
block/io_uring: resubmit when result is -EAGAIN
19
26
20
block/gluster.c | 78 ++++++++++++++++++++++++++++++---------------------------
27
Philippe Mathieu-Daudé (1):
21
configure | 6 +++++
28
MAINTAINERS: Added myself as a reviewer for the NVMe Block Driver
22
2 files changed, 47 insertions(+), 37 deletions(-)
29
30
Stefano Garzarella (1):
31
MAINTAINERS: add Stefano Garzarella as io_uring reviewer
32
33
MAINTAINERS | 2 ++
34
block/io_uring.c | 16 +++++++++++++++-
35
2 files changed, 17 insertions(+), 1 deletion(-)
23
36
24
--
37
--
25
2.9.3
38
2.31.1
26
39
27
diff view generated by jsdifflib
New patch
1
From: Stefano Garzarella <sgarzare@redhat.com>
1
2
3
I've been working with io_uring for a while so I'd like to help
4
with reviews.
5
6
Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
7
Message-Id: <20210728131515.131045-1-sgarzare@redhat.com>
8
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
9
---
10
MAINTAINERS | 1 +
11
1 file changed, 1 insertion(+)
12
13
diff --git a/MAINTAINERS b/MAINTAINERS
14
index XXXXXXX..XXXXXXX 100644
15
--- a/MAINTAINERS
16
+++ b/MAINTAINERS
17
@@ -XXX,XX +XXX,XX @@ Linux io_uring
18
M: Aarushi Mehta <mehta.aaru20@gmail.com>
19
M: Julia Suvorova <jusual@redhat.com>
20
M: Stefan Hajnoczi <stefanha@redhat.com>
21
+R: Stefano Garzarella <sgarzare@redhat.com>
22
L: qemu-block@nongnu.org
23
S: Maintained
24
F: block/io_uring.c
25
--
26
2.31.1
27
diff view generated by jsdifflib
New patch
1
From: Fabian Ebner <f.ebner@proxmox.com>
1
2
3
Linux SCSI can throw spurious -EAGAIN in some corner cases in its
4
completion path, which will end up being the result in the completed
5
io_uring request.
6
7
Resubmitting such requests should allow block jobs to complete, even
8
if such spurious errors are encountered.
9
10
Co-authored-by: Stefan Hajnoczi <stefanha@gmail.com>
11
Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>
12
Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
13
Message-id: 20210729091029.65369-1-f.ebner@proxmox.com
14
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
15
---
16
block/io_uring.c | 16 +++++++++++++++-
17
1 file changed, 15 insertions(+), 1 deletion(-)
18
19
diff --git a/block/io_uring.c b/block/io_uring.c
20
index XXXXXXX..XXXXXXX 100644
21
--- a/block/io_uring.c
22
+++ b/block/io_uring.c
23
@@ -XXX,XX +XXX,XX @@ static void luring_process_completions(LuringState *s)
24
total_bytes = ret + luringcb->total_read;
25
26
if (ret < 0) {
27
- if (ret == -EINTR) {
28
+ /*
29
+ * Only writev/readv/fsync requests on regular files or host block
30
+ * devices are submitted. Therefore -EAGAIN is not expected but it's
31
+ * known to happen sometimes with Linux SCSI. Submit again and hope
32
+ * the request completes successfully.
33
+ *
34
+ * For more information, see:
35
+ * https://lore.kernel.org/io-uring/20210727165811.284510-3-axboe@kernel.dk/T/#u
36
+ *
37
+ * If the code is changed to submit other types of requests in the
38
+ * future, then this workaround may need to be extended to deal with
39
+ * genuine -EAGAIN results that should not be resubmitted
40
+ * immediately.
41
+ */
42
+ if (ret == -EINTR || ret == -EAGAIN) {
43
luring_resubmit(s, luringcb);
44
continue;
45
}
46
--
47
2.31.1
48
diff view generated by jsdifflib
1
From: Niels de Vos <ndevos@redhat.com>
1
From: Philippe Mathieu-Daudé <philmd@redhat.com>
2
2
3
Add missing support for "preallocation=falloc" to the Gluster block
3
I'm interested in following the activity around the NVMe bdrv.
4
driver. This change bases its logic on that of block/file-posix.c and
5
removed the gluster_supports_zerofill() and qemu_gluster_zerofill()
6
functions in favour of #ifdef checks in an easy to read
7
switch-statement.
8
4
9
Both glfs_zerofill() and glfs_fallocate() have been introduced with
5
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
10
GlusterFS 3.5.0 (pkg-config glusterfs-api = 6). A #define for the
6
Message-id: 20210728183340.2018313-1-philmd@redhat.com
11
availability of glfs_fallocate() has been added to ./configure.
7
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
8
---
9
MAINTAINERS | 1 +
10
1 file changed, 1 insertion(+)
12
11
13
Reported-by: Satheesaran Sundaramoorthi <sasundar@redhat.com>
12
diff --git a/MAINTAINERS b/MAINTAINERS
14
Signed-off-by: Niels de Vos <ndevos@redhat.com>
13
index XXXXXXX..XXXXXXX 100644
15
Message-id: 20170528063114.28691-1-ndevos@redhat.com
14
--- a/MAINTAINERS
16
URL: https://bugzilla.redhat.com/1450759
15
+++ b/MAINTAINERS
17
Signed-off-by: Niels de Vos <ndevos@redhat.com>
16
@@ -XXX,XX +XXX,XX @@ F: block/null.c
18
Signed-off-by: Jeff Cody <jcody@redhat.com>
17
NVMe Block Driver
19
---
18
M: Stefan Hajnoczi <stefanha@redhat.com>
20
block/gluster.c | 78 ++++++++++++++++++++++++++++++---------------------------
19
R: Fam Zheng <fam@euphon.net>
21
configure | 6 +++++
20
+R: Philippe Mathieu-Daudé <philmd@redhat.com>
22
2 files changed, 47 insertions(+), 37 deletions(-)
21
L: qemu-block@nongnu.org
22
S: Supported
23
F: block/nvme*
24
--
25
2.31.1
23
26
24
diff --git a/block/gluster.c b/block/gluster.c
25
index XXXXXXX..XXXXXXX 100644
26
--- a/block/gluster.c
27
+++ b/block/gluster.c
28
@@ -XXX,XX +XXX,XX @@ static coroutine_fn int qemu_gluster_co_pwrite_zeroes(BlockDriverState *bs,
29
qemu_coroutine_yield();
30
return acb.ret;
31
}
32
-
33
-static inline bool gluster_supports_zerofill(void)
34
-{
35
- return 1;
36
-}
37
-
38
-static inline int qemu_gluster_zerofill(struct glfs_fd *fd, int64_t offset,
39
- int64_t size)
40
-{
41
- return glfs_zerofill(fd, offset, size);
42
-}
43
-
44
-#else
45
-static inline bool gluster_supports_zerofill(void)
46
-{
47
- return 0;
48
-}
49
-
50
-static inline int qemu_gluster_zerofill(struct glfs_fd *fd, int64_t offset,
51
- int64_t size)
52
-{
53
- return 0;
54
-}
55
#endif
56
57
static int qemu_gluster_create(const char *filename,
58
@@ -XXX,XX +XXX,XX @@ static int qemu_gluster_create(const char *filename,
59
struct glfs *glfs;
60
struct glfs_fd *fd;
61
int ret = 0;
62
- int prealloc = 0;
63
+ PreallocMode prealloc;
64
int64_t total_size = 0;
65
char *tmp = NULL;
66
+ Error *local_err = NULL;
67
68
gconf = g_new0(BlockdevOptionsGluster, 1);
69
gconf->debug = qemu_opt_get_number_del(opts, GLUSTER_OPT_DEBUG,
70
@@ -XXX,XX +XXX,XX @@ static int qemu_gluster_create(const char *filename,
71
BDRV_SECTOR_SIZE);
72
73
tmp = qemu_opt_get_del(opts, BLOCK_OPT_PREALLOC);
74
- if (!tmp || !strcmp(tmp, "off")) {
75
- prealloc = 0;
76
- } else if (!strcmp(tmp, "full") && gluster_supports_zerofill()) {
77
- prealloc = 1;
78
- } else {
79
- error_setg(errp, "Invalid preallocation mode: '%s'"
80
- " or GlusterFS doesn't support zerofill API", tmp);
81
+ prealloc = qapi_enum_parse(PreallocMode_lookup, tmp,
82
+ PREALLOC_MODE__MAX, PREALLOC_MODE_OFF,
83
+ &local_err);
84
+ g_free(tmp);
85
+ if (local_err) {
86
+ error_propagate(errp, local_err);
87
ret = -EINVAL;
88
goto out;
89
}
90
@@ -XXX,XX +XXX,XX @@ static int qemu_gluster_create(const char *filename,
91
O_WRONLY | O_CREAT | O_TRUNC | O_BINARY, S_IRUSR | S_IWUSR);
92
if (!fd) {
93
ret = -errno;
94
- } else {
95
+ goto out;
96
+ }
97
+
98
+ switch (prealloc) {
99
+#ifdef CONFIG_GLUSTERFS_FALLOCATE
100
+ case PREALLOC_MODE_FALLOC:
101
+ if (glfs_fallocate(fd, 0, 0, total_size)) {
102
+ error_setg(errp, "Could not preallocate data for the new file");
103
+ ret = -errno;
104
+ }
105
+ break;
106
+#endif /* CONFIG_GLUSTERFS_FALLOCATE */
107
+#ifdef CONFIG_GLUSTERFS_ZEROFILL
108
+ case PREALLOC_MODE_FULL:
109
if (!glfs_ftruncate(fd, total_size)) {
110
- if (prealloc && qemu_gluster_zerofill(fd, 0, total_size)) {
111
+ if (glfs_zerofill(fd, 0, total_size)) {
112
+ error_setg(errp, "Could not zerofill the new file");
113
ret = -errno;
114
}
115
} else {
116
+ error_setg(errp, "Could not resize file");
117
ret = -errno;
118
}
119
+ break;
120
+#endif /* CONFIG_GLUSTERFS_ZEROFILL */
121
+ case PREALLOC_MODE_OFF:
122
+ if (glfs_ftruncate(fd, total_size) != 0) {
123
+ ret = -errno;
124
+ error_setg(errp, "Could not resize file");
125
+ }
126
+ break;
127
+ default:
128
+ ret = -EINVAL;
129
+ error_setg(errp, "Unsupported preallocation mode: %s",
130
+ PreallocMode_lookup[prealloc]);
131
+ break;
132
+ }
133
134
- if (glfs_close(fd) != 0) {
135
- ret = -errno;
136
- }
137
+ if (glfs_close(fd) != 0) {
138
+ ret = -errno;
139
}
140
out:
141
- g_free(tmp);
142
qapi_free_BlockdevOptionsGluster(gconf);
143
glfs_clear_preopened(glfs);
144
return ret;
145
diff --git a/configure b/configure
146
index XXXXXXX..XXXXXXX 100755
147
--- a/configure
148
+++ b/configure
149
@@ -XXX,XX +XXX,XX @@ seccomp=""
150
glusterfs=""
151
glusterfs_xlator_opt="no"
152
glusterfs_discard="no"
153
+glusterfs_fallocate="no"
154
glusterfs_zerofill="no"
155
gtk=""
156
gtkabi=""
157
@@ -XXX,XX +XXX,XX @@ if test "$glusterfs" != "no" ; then
158
glusterfs_discard="yes"
159
fi
160
if $pkg_config --atleast-version=6 glusterfs-api; then
161
+ glusterfs_fallocate="yes"
162
glusterfs_zerofill="yes"
163
fi
164
else
165
@@ -XXX,XX +XXX,XX @@ if test "$glusterfs_discard" = "yes" ; then
166
echo "CONFIG_GLUSTERFS_DISCARD=y" >> $config_host_mak
167
fi
168
169
+if test "$glusterfs_fallocate" = "yes" ; then
170
+ echo "CONFIG_GLUSTERFS_FALLOCATE=y" >> $config_host_mak
171
+fi
172
+
173
if test "$glusterfs_zerofill" = "yes" ; then
174
echo "CONFIG_GLUSTERFS_ZEROFILL=y" >> $config_host_mak
175
fi
176
--
177
2.9.3
178
179
diff view generated by jsdifflib