* [PATCH] Fix linux build under sid and trixie
@ 2024-09-27 6:36 Uladzimir Bely
2024-09-27 13:14 ` 'Jan Kiszka' via isar-users
0 siblings, 1 reply; 4+ messages in thread
From: Uladzimir Bely @ 2024-09-27 6:36 UTC (permalink / raw)
To: isar-users
The patch for kernel is taken from the upstream where it
was applied since linux-6.8.
Signed-off-by: Uladzimir Bely <ubely@ilbers.de>
---
...oc-arguments-order-in-btrfs_ioctl_se.patch | 43 +++++++++++++++++++
.../linux/linux-mainline_6.6.11.bb | 1 +
.../linux/linux-starfive_6.6-visionfive2.bb | 1 +
3 files changed, 45 insertions(+)
create mode 100644 meta-isar/recipes-kernel/linux/files/0001-btrfs-fix-kvcalloc-arguments-order-in-btrfs_ioctl_se.patch
diff --git a/meta-isar/recipes-kernel/linux/files/0001-btrfs-fix-kvcalloc-arguments-order-in-btrfs_ioctl_se.patch b/meta-isar/recipes-kernel/linux/files/0001-btrfs-fix-kvcalloc-arguments-order-in-btrfs_ioctl_se.patch
new file mode 100644
index 00000000..afe09eab
--- /dev/null
+++ b/meta-isar/recipes-kernel/linux/files/0001-btrfs-fix-kvcalloc-arguments-order-in-btrfs_ioctl_se.patch
@@ -0,0 +1,43 @@
+From 6ff09b6b8c2fb6b3edda4ffaa173153a40653067 Mon Sep 17 00:00:00 2001
+From: Dmitry Antipov <dmantipov@yandex.ru>
+Date: Thu, 21 Dec 2023 11:47:45 +0300
+Subject: [PATCH] btrfs: fix kvcalloc() arguments order in btrfs_ioctl_send()
+
+When compiling with gcc version 14.0.0 20231220 (experimental)
+and W=1, I've noticed the following warning:
+
+fs/btrfs/send.c: In function 'btrfs_ioctl_send':
+fs/btrfs/send.c:8208:44: warning: 'kvcalloc' sizes specified with 'sizeof'
+in the earlier argument and not in the later argument [-Wcalloc-transposed-args]
+ 8208 | sctx->clone_roots = kvcalloc(sizeof(*sctx->clone_roots),
+ | ^
+
+Since 'n' and 'size' arguments of 'kvcalloc()' are multiplied to
+calculate the final size, their actual order doesn't affect the result
+and so this is not a bug. But it's still worth to fix it.
+
+Signed-off-by: Dmitry Antipov <dmantipov@yandex.ru>
+Reviewed-by: David Sterba <dsterba@suse.com>
+Signed-off-by: David Sterba <dsterba@suse.com>
+---
+ fs/btrfs/send.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/fs/btrfs/send.c b/fs/btrfs/send.c
+index 4e36550618e5..2d7519a6ce72 100644
+--- a/fs/btrfs/send.c
++++ b/fs/btrfs/send.c
+@@ -8205,8 +8205,8 @@ long btrfs_ioctl_send(struct inode *inode, struct btrfs_ioctl_send_args *arg)
+ goto out;
+ }
+
+- sctx->clone_roots = kvcalloc(sizeof(*sctx->clone_roots),
+- arg->clone_sources_count + 1,
++ sctx->clone_roots = kvcalloc(arg->clone_sources_count + 1,
++ sizeof(*sctx->clone_roots),
+ GFP_KERNEL);
+ if (!sctx->clone_roots) {
+ ret = -ENOMEM;
+--
+2.45.2
+
diff --git a/meta-isar/recipes-kernel/linux/linux-mainline_6.6.11.bb b/meta-isar/recipes-kernel/linux/linux-mainline_6.6.11.bb
index 2287e763..147d05df 100644
--- a/meta-isar/recipes-kernel/linux/linux-mainline_6.6.11.bb
+++ b/meta-isar/recipes-kernel/linux/linux-mainline_6.6.11.bb
@@ -11,6 +11,7 @@ ARCHIVE_VERSION = "${@ d.getVar('PV')[:-2] if d.getVar('PV').endswith('.0') else
SRC_URI += " \
https://cdn.kernel.org/pub/linux/kernel/v6.x/linux-${ARCHIVE_VERSION}.tar.xz \
+ file://0001-btrfs-fix-kvcalloc-arguments-order-in-btrfs_ioctl_se.patch \
file://x86_64_defconfig \
file://ftpm-module.cfg \
file://subdir/no-ubifs-fs.cfg \
diff --git a/meta-isar/recipes-kernel/linux/linux-starfive_6.6-visionfive2.bb b/meta-isar/recipes-kernel/linux/linux-starfive_6.6-visionfive2.bb
index f4dd5c9a..a267241f 100644
--- a/meta-isar/recipes-kernel/linux/linux-starfive_6.6-visionfive2.bb
+++ b/meta-isar/recipes-kernel/linux/linux-starfive_6.6-visionfive2.bb
@@ -8,6 +8,7 @@ require recipes-kernel/linux/linux-custom.inc
SRC_URI += " \
https://github.com/starfive-tech/linux/archive/${SRCREV}.tar.gz;downloadfilename=linux-starfive-${SRCREV}.tar.gz \
file://0001-riscv-efistub-Ensure-GP-relative-addressing-is-not-u.patch \
+ file://0001-btrfs-fix-kvcalloc-arguments-order-in-btrfs_ioctl_se.patch \
file://starfive2_extra.cfg"
SRCREV = "9fe004eaf1aa5b23bd5d03b4cfe9c3858bd884c4"
SRC_URI[sha256sum] = "9eaf7659aa57e2c5b399b7b33076f1376ec43ef343680e0a57e0a2a9bef6c0ae"
--
2.45.2
--
You received this message because you are subscribed to the Google Groups "isar-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to isar-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/isar-users/20240927063647.25660-1-ubely%40ilbers.de.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] Fix linux build under sid and trixie
2024-09-27 6:36 [PATCH] Fix linux build under sid and trixie Uladzimir Bely
@ 2024-09-27 13:14 ` 'Jan Kiszka' via isar-users
2024-09-27 16:32 ` Uladzimir Bely
0 siblings, 1 reply; 4+ messages in thread
From: 'Jan Kiszka' via isar-users @ 2024-09-27 13:14 UTC (permalink / raw)
To: Uladzimir Bely, isar-users
On 27.09.24 08:36, Uladzimir Bely wrote:
> The patch for kernel is taken from the upstream where it
> was applied since linux-6.8.
This does not make any sense. Update the stable version.
Jan
>
> Signed-off-by: Uladzimir Bely <ubely@ilbers.de>
> ---
> ...oc-arguments-order-in-btrfs_ioctl_se.patch | 43 +++++++++++++++++++
> .../linux/linux-mainline_6.6.11.bb | 1 +
> .../linux/linux-starfive_6.6-visionfive2.bb | 1 +
> 3 files changed, 45 insertions(+)
> create mode 100644 meta-isar/recipes-kernel/linux/files/0001-btrfs-fix-kvcalloc-arguments-order-in-btrfs_ioctl_se.patch
>
> diff --git a/meta-isar/recipes-kernel/linux/files/0001-btrfs-fix-kvcalloc-arguments-order-in-btrfs_ioctl_se.patch b/meta-isar/recipes-kernel/linux/files/0001-btrfs-fix-kvcalloc-arguments-order-in-btrfs_ioctl_se.patch
> new file mode 100644
> index 00000000..afe09eab
> --- /dev/null
> +++ b/meta-isar/recipes-kernel/linux/files/0001-btrfs-fix-kvcalloc-arguments-order-in-btrfs_ioctl_se.patch
> @@ -0,0 +1,43 @@
> +From 6ff09b6b8c2fb6b3edda4ffaa173153a40653067 Mon Sep 17 00:00:00 2001
> +From: Dmitry Antipov <dmantipov@yandex.ru>
> +Date: Thu, 21 Dec 2023 11:47:45 +0300
> +Subject: [PATCH] btrfs: fix kvcalloc() arguments order in btrfs_ioctl_send()
> +
> +When compiling with gcc version 14.0.0 20231220 (experimental)
> +and W=1, I've noticed the following warning:
> +
> +fs/btrfs/send.c: In function 'btrfs_ioctl_send':
> +fs/btrfs/send.c:8208:44: warning: 'kvcalloc' sizes specified with 'sizeof'
> +in the earlier argument and not in the later argument [-Wcalloc-transposed-args]
> + 8208 | sctx->clone_roots = kvcalloc(sizeof(*sctx->clone_roots),
> + | ^
> +
> +Since 'n' and 'size' arguments of 'kvcalloc()' are multiplied to
> +calculate the final size, their actual order doesn't affect the result
> +and so this is not a bug. But it's still worth to fix it.
> +
> +Signed-off-by: Dmitry Antipov <dmantipov@yandex.ru>
> +Reviewed-by: David Sterba <dsterba@suse.com>
> +Signed-off-by: David Sterba <dsterba@suse.com>
> +---
> + fs/btrfs/send.c | 4 ++--
> + 1 file changed, 2 insertions(+), 2 deletions(-)
> +
> +diff --git a/fs/btrfs/send.c b/fs/btrfs/send.c
> +index 4e36550618e5..2d7519a6ce72 100644
> +--- a/fs/btrfs/send.c
> ++++ b/fs/btrfs/send.c
> +@@ -8205,8 +8205,8 @@ long btrfs_ioctl_send(struct inode *inode, struct btrfs_ioctl_send_args *arg)
> + goto out;
> + }
> +
> +- sctx->clone_roots = kvcalloc(sizeof(*sctx->clone_roots),
> +- arg->clone_sources_count + 1,
> ++ sctx->clone_roots = kvcalloc(arg->clone_sources_count + 1,
> ++ sizeof(*sctx->clone_roots),
> + GFP_KERNEL);
> + if (!sctx->clone_roots) {
> + ret = -ENOMEM;
> +--
> +2.45.2
> +
> diff --git a/meta-isar/recipes-kernel/linux/linux-mainline_6.6.11.bb b/meta-isar/recipes-kernel/linux/linux-mainline_6.6.11.bb
> index 2287e763..147d05df 100644
> --- a/meta-isar/recipes-kernel/linux/linux-mainline_6.6.11.bb
> +++ b/meta-isar/recipes-kernel/linux/linux-mainline_6.6.11.bb
> @@ -11,6 +11,7 @@ ARCHIVE_VERSION = "${@ d.getVar('PV')[:-2] if d.getVar('PV').endswith('.0') else
>
> SRC_URI += " \
> https://cdn.kernel.org/pub/linux/kernel/v6.x/linux-${ARCHIVE_VERSION}.tar.xz \
> + file://0001-btrfs-fix-kvcalloc-arguments-order-in-btrfs_ioctl_se.patch \
> file://x86_64_defconfig \
> file://ftpm-module.cfg \
> file://subdir/no-ubifs-fs.cfg \
> diff --git a/meta-isar/recipes-kernel/linux/linux-starfive_6.6-visionfive2.bb b/meta-isar/recipes-kernel/linux/linux-starfive_6.6-visionfive2.bb
> index f4dd5c9a..a267241f 100644
> --- a/meta-isar/recipes-kernel/linux/linux-starfive_6.6-visionfive2.bb
> +++ b/meta-isar/recipes-kernel/linux/linux-starfive_6.6-visionfive2.bb
> @@ -8,6 +8,7 @@ require recipes-kernel/linux/linux-custom.inc
> SRC_URI += " \
> https://github.com/starfive-tech/linux/archive/${SRCREV}.tar.gz;downloadfilename=linux-starfive-${SRCREV}.tar.gz \
> file://0001-riscv-efistub-Ensure-GP-relative-addressing-is-not-u.patch \
> + file://0001-btrfs-fix-kvcalloc-arguments-order-in-btrfs_ioctl_se.patch \
> file://starfive2_extra.cfg"
> SRCREV = "9fe004eaf1aa5b23bd5d03b4cfe9c3858bd884c4"
> SRC_URI[sha256sum] = "9eaf7659aa57e2c5b399b7b33076f1376ec43ef343680e0a57e0a2a9bef6c0ae"
--
Siemens AG, Technology
Linux Expert Center
--
You received this message because you are subscribed to the Google Groups "isar-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to isar-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/isar-users/4634748f-5979-4142-9aef-f21da941e95a%40siemens.com.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] Fix linux build under sid and trixie
2024-09-27 13:14 ` 'Jan Kiszka' via isar-users
@ 2024-09-27 16:32 ` Uladzimir Bely
2024-09-27 17:18 ` 'Jan Kiszka' via isar-users
0 siblings, 1 reply; 4+ messages in thread
From: Uladzimir Bely @ 2024-09-27 16:32 UTC (permalink / raw)
To: Jan Kiszka, isar-users
On Fri, 2024-09-27 at 15:14 +0200, Jan Kiszka wrote:
> On 27.09.24 08:36, Uladzimir Bely wrote:
> > The patch for kernel is taken from the upstream where it
> > was applied since linux-6.8.
>
> This does not make any sense. Update the stable version.
>
> Jan
>
Hello.
Actually, build fails only for starfive target that uses non-mainline
custom linux repo not haveing a branch with linux >= 6.7.
I think, the patch is worth applying at least for linux-starfive_6.6-
visionfive2.bb.
Other targets are using bookworm at most, so for could leave them as is
for now.
What do you think?
> >
> > Signed-off-by: Uladzimir Bely <ubely@ilbers.de>
> > ---
> > ...oc-arguments-order-in-btrfs_ioctl_se.patch | 43
> > +++++++++++++++++++
> > .../linux/linux-mainline_6.6.11.bb | 1 +
> > .../linux/linux-starfive_6.6-visionfive2.bb | 1 +
> > 3 files changed, 45 insertions(+)
> > create mode 100644 meta-isar/recipes-kernel/linux/files/0001-
> > btrfs-fix-kvcalloc-arguments-order-in-btrfs_ioctl_se.patch
> >
> > diff --git a/meta-isar/recipes-kernel/linux/files/0001-btrfs-fix-
> > kvcalloc-arguments-order-in-btrfs_ioctl_se.patch b/meta-
> > isar/recipes-kernel/linux/files/0001-btrfs-fix-kvcalloc-arguments-
> > order-in-btrfs_ioctl_se.patch
> > new file mode 100644
> > index 00000000..afe09eab
> > --- /dev/null
> > +++ b/meta-isar/recipes-kernel/linux/files/0001-btrfs-fix-kvcalloc-
> > arguments-order-in-btrfs_ioctl_se.patch
> > @@ -0,0 +1,43 @@
> > +From 6ff09b6b8c2fb6b3edda4ffaa173153a40653067 Mon Sep 17 00:00:00
> > 2001
> > +From: Dmitry Antipov <dmantipov@yandex.ru>
> > +Date: Thu, 21 Dec 2023 11:47:45 +0300
> > +Subject: [PATCH] btrfs: fix kvcalloc() arguments order in
> > btrfs_ioctl_send()
> > +
> > +When compiling with gcc version 14.0.0 20231220 (experimental)
> > +and W=1, I've noticed the following warning:
> > +
> > +fs/btrfs/send.c: In function 'btrfs_ioctl_send':
> > +fs/btrfs/send.c:8208:44: warning: 'kvcalloc' sizes specified with
> > 'sizeof'
> > +in the earlier argument and not in the later argument [-Wcalloc-
> > transposed-args]
> > + 8208 | sctx->clone_roots = kvcalloc(sizeof(*sctx-
> > >clone_roots),
> > + | ^
> > +
> > +Since 'n' and 'size' arguments of 'kvcalloc()' are multiplied to
> > +calculate the final size, their actual order doesn't affect the
> > result
> > +and so this is not a bug. But it's still worth to fix it.
> > +
> > +Signed-off-by: Dmitry Antipov <dmantipov@yandex.ru>
> > +Reviewed-by: David Sterba <dsterba@suse.com>
> > +Signed-off-by: David Sterba <dsterba@suse.com>
> > +---
> > + fs/btrfs/send.c | 4 ++--
> > + 1 file changed, 2 insertions(+), 2 deletions(-)
> > +
> > +diff --git a/fs/btrfs/send.c b/fs/btrfs/send.c
> > +index 4e36550618e5..2d7519a6ce72 100644
> > +--- a/fs/btrfs/send.c
> > ++++ b/fs/btrfs/send.c
> > +@@ -8205,8 +8205,8 @@ long btrfs_ioctl_send(struct inode *inode,
> > struct btrfs_ioctl_send_args *arg)
> > + goto out;
> > + }
> > +
> > +- sctx->clone_roots = kvcalloc(sizeof(*sctx->clone_roots),
> > +- arg->clone_sources_count + 1,
> > ++ sctx->clone_roots = kvcalloc(arg->clone_sources_count + 1,
> > ++ sizeof(*sctx->clone_roots),
> > + GFP_KERNEL);
> > + if (!sctx->clone_roots) {
> > + ret = -ENOMEM;
> > +--
> > +2.45.2
> > +
> > diff --git a/meta-isar/recipes-kernel/linux/linux-
> > mainline_6.6.11.bb b/meta-isar/recipes-kernel/linux/linux-
> > mainline_6.6.11.bb
> > index 2287e763..147d05df 100644
> > --- a/meta-isar/recipes-kernel/linux/linux-mainline_6.6.11.bb
> > +++ b/meta-isar/recipes-kernel/linux/linux-mainline_6.6.11.bb
> > @@ -11,6 +11,7 @@ ARCHIVE_VERSION = "${@ d.getVar('PV')[:-2] if
> > d.getVar('PV').endswith('.0') else
> >
> > SRC_URI += " \
> >
> > https://cdn.kernel.org/pub/linux/kernel/v6.x/linux-${ARCHIVE_VERSION}.tar.xz
> > \
> > +
> > file://0001-btrfs-fix-kvcalloc-arguments-order-in-btrfs_ioctl_se.patch
> > \
> > file://x86_64_defconfig \
> > file://ftpm-module.cfg \
> > file://subdir/no-ubifs-fs.cfg \
> > diff --git a/meta-isar/recipes-kernel/linux/linux-starfive_6.6-
> > visionfive2.bb b/meta-isar/recipes-kernel/linux/linux-starfive_6.6-
> > visionfive2.bb
> > index f4dd5c9a..a267241f 100644
> > --- a/meta-isar/recipes-kernel/linux/linux-starfive_6.6-
> > visionfive2.bb
> > +++ b/meta-isar/recipes-kernel/linux/linux-starfive_6.6-
> > visionfive2.bb
> > @@ -8,6 +8,7 @@ require recipes-kernel/linux/linux-custom.inc
> > SRC_URI += " \
> >
> > https://github.com/starfive-tech/linux/archive/${SRCREV}.tar.gz;downloadfilename=linux-starfive-${SRCREV}.tar.gz
> > \
> >
> > file://0001-riscv-efistub-Ensure-GP-relative-addressing-is-not-u.patch
> > \
> > +
> > file://0001-btrfs-fix-kvcalloc-arguments-order-in-btrfs_ioctl_se.patch
> > \
> > file://starfive2_extra.cfg"
> > SRCREV = "9fe004eaf1aa5b23bd5d03b4cfe9c3858bd884c4"
> > SRC_URI[sha256sum] =
> > "9eaf7659aa57e2c5b399b7b33076f1376ec43ef343680e0a57e0a2a9bef6c0ae"
>
--
Best regards,
Uladzimir.
--
You received this message because you are subscribed to the Google Groups "isar-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to isar-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/isar-users/8241287c797aff79f4cbd359e6d2f72b8f12debd.camel%40ilbers.de.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] Fix linux build under sid and trixie
2024-09-27 16:32 ` Uladzimir Bely
@ 2024-09-27 17:18 ` 'Jan Kiszka' via isar-users
0 siblings, 0 replies; 4+ messages in thread
From: 'Jan Kiszka' via isar-users @ 2024-09-27 17:18 UTC (permalink / raw)
To: Uladzimir Bely, isar-users
On 27.09.24 18:32, Uladzimir Bely wrote:
> On Fri, 2024-09-27 at 15:14 +0200, Jan Kiszka wrote:
>> On 27.09.24 08:36, Uladzimir Bely wrote:
>>> The patch for kernel is taken from the upstream where it
>>> was applied since linux-6.8.
>>
>> This does not make any sense. Update the stable version.
>>
>> Jan
>>
>
> Hello.
>
> Actually, build fails only for starfive target that uses non-mainline
> custom linux repo not haveing a branch with linux >= 6.7.
>
> I think, the patch is worth applying at least for linux-starfive_6.6-
> visionfive2.bb.
>
> Other targets are using bookworm at most, so for could leave them as is
> for now.
>
> What do you think?
Just update the starfive kernel to its latest 6.6 revision.
Jan
--
Siemens AG, Technology
Linux Expert Center
--
You received this message because you are subscribed to the Google Groups "isar-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to isar-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/isar-users/54f8aa6d-10d3-41b3-84bd-7111aef77f9c%40siemens.com.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2024-09-27 17:18 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-09-27 6:36 [PATCH] Fix linux build under sid and trixie Uladzimir Bely
2024-09-27 13:14 ` 'Jan Kiszka' via isar-users
2024-09-27 16:32 ` Uladzimir Bely
2024-09-27 17:18 ` 'Jan Kiszka' via isar-users
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox