* [PATCH v2] block/export/fuse.c: fix musl build
@ 2021-08-09 9:51 Fabrice Fontaine
2021-08-09 10:27 ` [PATCH-for-6.1 " Philippe Mathieu-Daudé
2021-08-09 15:29 ` [PATCH " Hanna Reitz
0 siblings, 2 replies; 4+ messages in thread
From: Fabrice Fontaine @ 2021-08-09 9:51 UTC (permalink / raw)
To: qemu-devel; +Cc: Fabrice Fontaine, Max Reitz
Fix the following build failure on musl raised since version 6.0.0 and
https://gitlab.com/qemu-project/qemu/-/commit/4ca37a96a75aafe7a37ba51ab1912b09b7190a6b
because musl does not define FALLOC_FL_ZERO_RANGE:
../block/export/fuse.c: In function 'fuse_fallocate':
../block/export/fuse.c:563:23: error: 'FALLOC_FL_ZERO_RANGE' undeclared (first use in this function)
563 | } else if (mode & FALLOC_FL_ZERO_RANGE) {
| ^~~~~~~~~~~~~~~~~~~~
Fixes:
- http://autobuild.buildroot.org/results/b96e3d364fd1f8bbfb18904a742e73327d308f64
Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
---
Changes v1 -> v2 (after review of Philippe Mathieu-Daudé):
- Use CONFIG_FALLOCATE_ZERO_RANGE and make safer #ifdef'ry
block/export/fuse.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/block/export/fuse.c b/block/export/fuse.c
index ada9e263eb..fc7b07d2b5 100644
--- a/block/export/fuse.c
+++ b/block/export/fuse.c
@@ -635,7 +635,9 @@ static void fuse_fallocate(fuse_req_t req, fuse_ino_t inode, int mode,
offset += size;
length -= size;
} while (ret == 0 && length > 0);
- } else if (mode & FALLOC_FL_ZERO_RANGE) {
+ }
+#ifdef CONFIG_FALLOCATE_ZERO_RANGE
+ else if (mode & FALLOC_FL_ZERO_RANGE) {
if (!(mode & FALLOC_FL_KEEP_SIZE) && offset + length > blk_len) {
/* No need for zeroes, we are going to write them ourselves */
ret = fuse_do_truncate(exp, offset + length, false,
@@ -654,7 +656,9 @@ static void fuse_fallocate(fuse_req_t req, fuse_ino_t inode, int mode,
offset += size;
length -= size;
} while (ret == 0 && length > 0);
- } else if (!mode) {
+ }
+#endif /* CONFIG_FALLOCATE_ZERO_RANGE */
+ else if (!mode) {
/* We can only fallocate at the EOF with a truncate */
if (offset < blk_len) {
fuse_reply_err(req, EOPNOTSUPP);
--
2.30.2
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH-for-6.1 v2] block/export/fuse.c: fix musl build
2021-08-09 9:51 [PATCH v2] block/export/fuse.c: fix musl build Fabrice Fontaine
@ 2021-08-09 10:27 ` Philippe Mathieu-Daudé
2021-08-09 11:05 ` Denis V. Lunev
2021-08-09 15:29 ` [PATCH " Hanna Reitz
1 sibling, 1 reply; 4+ messages in thread
From: Philippe Mathieu-Daudé @ 2021-08-09 10:27 UTC (permalink / raw)
To: Fabrice Fontaine, qemu-devel; +Cc: Denis V. Lunev, Qemu-block, Max Reitz
On 8/9/21 11:51 AM, Fabrice Fontaine wrote:
> Fix the following build failure on musl raised since version 6.0.0 and
> https://gitlab.com/qemu-project/qemu/-/commit/4ca37a96a75aafe7a37ba51ab1912b09b7190a6b
> because musl does not define FALLOC_FL_ZERO_RANGE:
>
> ../block/export/fuse.c: In function 'fuse_fallocate':
> ../block/export/fuse.c:563:23: error: 'FALLOC_FL_ZERO_RANGE' undeclared (first use in this function)
> 563 | } else if (mode & FALLOC_FL_ZERO_RANGE) {
> | ^~~~~~~~~~~~~~~~~~~~
>
> Fixes:
> - http://autobuild.buildroot.org/results/b96e3d364fd1f8bbfb18904a742e73327d308f64
>
> Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
> ---
> Changes v1 -> v2 (after review of Philippe Mathieu-Daudé):
> - Use CONFIG_FALLOCATE_ZERO_RANGE and make safer #ifdef'ry
>
> block/export/fuse.c | 8 ++++++--
> 1 file changed, 6 insertions(+), 2 deletions(-)
>
> diff --git a/block/export/fuse.c b/block/export/fuse.c
> index ada9e263eb..fc7b07d2b5 100644
> --- a/block/export/fuse.c
> +++ b/block/export/fuse.c
> @@ -635,7 +635,9 @@ static void fuse_fallocate(fuse_req_t req, fuse_ino_t inode, int mode,
> offset += size;
> length -= size;
> } while (ret == 0 && length > 0);
> - } else if (mode & FALLOC_FL_ZERO_RANGE) {
> + }
> +#ifdef CONFIG_FALLOCATE_ZERO_RANGE
> + else if (mode & FALLOC_FL_ZERO_RANGE) {
> if (!(mode & FALLOC_FL_KEEP_SIZE) && offset + length > blk_len) {
> /* No need for zeroes, we are going to write them ourselves */
> ret = fuse_do_truncate(exp, offset + length, false,
> @@ -654,7 +656,9 @@ static void fuse_fallocate(fuse_req_t req, fuse_ino_t inode, int mode,
> offset += size;
> length -= size;
> } while (ret == 0 && length > 0);
> - } else if (!mode) {
> + }
> +#endif /* CONFIG_FALLOCATE_ZERO_RANGE */
> + else if (!mode) {
> /* We can only fallocate at the EOF with a truncate */
> if (offset < blk_len) {
> fuse_reply_err(req, EOPNOTSUPP);
>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH-for-6.1 v2] block/export/fuse.c: fix musl build
2021-08-09 10:27 ` [PATCH-for-6.1 " Philippe Mathieu-Daudé
@ 2021-08-09 11:05 ` Denis V. Lunev
0 siblings, 0 replies; 4+ messages in thread
From: Denis V. Lunev @ 2021-08-09 11:05 UTC (permalink / raw)
To: Philippe Mathieu-Daudé, Fabrice Fontaine, qemu-devel
Cc: Qemu-block, Max Reitz
On 8/9/21 1:27 PM, Philippe Mathieu-Daudé wrote:
> On 8/9/21 11:51 AM, Fabrice Fontaine wrote:
>> Fix the following build failure on musl raised since version 6.0.0 and
>> https://gitlab.com/qemu-project/qemu/-/commit/4ca37a96a75aafe7a37ba51ab1912b09b7190a6b
>> because musl does not define FALLOC_FL_ZERO_RANGE:
>>
>> ../block/export/fuse.c: In function 'fuse_fallocate':
>> ../block/export/fuse.c:563:23: error: 'FALLOC_FL_ZERO_RANGE' undeclared (first use in this function)
>> 563 | } else if (mode & FALLOC_FL_ZERO_RANGE) {
>> | ^~~~~~~~~~~~~~~~~~~~
>>
>> Fixes:
>> - http://autobuild.buildroot.org/results/b96e3d364fd1f8bbfb18904a742e73327d308f64
>>
>> Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
>> ---
>> Changes v1 -> v2 (after review of Philippe Mathieu-Daudé):
>> - Use CONFIG_FALLOCATE_ZERO_RANGE and make safer #ifdef'ry
>>
>> block/export/fuse.c | 8 ++++++--
>> 1 file changed, 6 insertions(+), 2 deletions(-)
>>
>> diff --git a/block/export/fuse.c b/block/export/fuse.c
>> index ada9e263eb..fc7b07d2b5 100644
>> --- a/block/export/fuse.c
>> +++ b/block/export/fuse.c
>> @@ -635,7 +635,9 @@ static void fuse_fallocate(fuse_req_t req, fuse_ino_t inode, int mode,
>> offset += size;
>> length -= size;
>> } while (ret == 0 && length > 0);
>> - } else if (mode & FALLOC_FL_ZERO_RANGE) {
>> + }
>> +#ifdef CONFIG_FALLOCATE_ZERO_RANGE
>> + else if (mode & FALLOC_FL_ZERO_RANGE) {
>> if (!(mode & FALLOC_FL_KEEP_SIZE) && offset + length > blk_len) {
>> /* No need for zeroes, we are going to write them ourselves */
>> ret = fuse_do_truncate(exp, offset + length, false,
>> @@ -654,7 +656,9 @@ static void fuse_fallocate(fuse_req_t req, fuse_ino_t inode, int mode,
>> offset += size;
>> length -= size;
>> } while (ret == 0 && length > 0);
>> - } else if (!mode) {
>> + }
>> +#endif /* CONFIG_FALLOCATE_ZERO_RANGE */
>> + else if (!mode) {
>> /* We can only fallocate at the EOF with a truncate */
>> if (offset < blk_len) {
>> fuse_reply_err(req, EOPNOTSUPP);
>>
> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
>
Reviewed-by: Denis V. Lunev <den@openvz.org>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v2] block/export/fuse.c: fix musl build
2021-08-09 9:51 [PATCH v2] block/export/fuse.c: fix musl build Fabrice Fontaine
2021-08-09 10:27 ` [PATCH-for-6.1 " Philippe Mathieu-Daudé
@ 2021-08-09 15:29 ` Hanna Reitz
1 sibling, 0 replies; 4+ messages in thread
From: Hanna Reitz @ 2021-08-09 15:29 UTC (permalink / raw)
To: Fabrice Fontaine, qemu-devel
On 09.08.21 11:51, Fabrice Fontaine wrote:
> Fix the following build failure on musl raised since version 6.0.0 and
> https://gitlab.com/qemu-project/qemu/-/commit/4ca37a96a75aafe7a37ba51ab1912b09b7190a6b
> because musl does not define FALLOC_FL_ZERO_RANGE:
>
> ../block/export/fuse.c: In function 'fuse_fallocate':
> ../block/export/fuse.c:563:23: error: 'FALLOC_FL_ZERO_RANGE' undeclared (first use in this function)
> 563 | } else if (mode & FALLOC_FL_ZERO_RANGE) {
> | ^~~~~~~~~~~~~~~~~~~~
>
> Fixes:
> - http://autobuild.buildroot.org/results/b96e3d364fd1f8bbfb18904a742e73327d308f64
>
> Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
> ---
> Changes v1 -> v2 (after review of Philippe Mathieu-Daudé):
> - Use CONFIG_FALLOCATE_ZERO_RANGE and make safer #ifdef'ry
>
> block/export/fuse.c | 8 ++++++--
> 1 file changed, 6 insertions(+), 2 deletions(-)
Thanks, applied to my block branch:
https://github.com/XanClic/qemu/commits/block
(Of note: I’ve had an email address change today, so sending the pull
request may become a bit hairy. If it doesn’t work out, I’ll have to
ask Kevin (or Peter directly, given this is a build fix) tomorrow.)
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2021-08-09 15:30 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-09 9:51 [PATCH v2] block/export/fuse.c: fix musl build Fabrice Fontaine
2021-08-09 10:27 ` [PATCH-for-6.1 " Philippe Mathieu-Daudé
2021-08-09 11:05 ` Denis V. Lunev
2021-08-09 15:29 ` [PATCH " Hanna Reitz
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.