linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] virtiofs: don't mark virtio_fs_sysfs_exit as __exit
@ 2024-02-28 21:46 Arnd Bergmann
  2024-02-28 22:23 ` Stefan Hajnoczi
  0 siblings, 1 reply; 2+ messages in thread
From: Arnd Bergmann @ 2024-02-28 21:46 UTC (permalink / raw)
  To: Vivek Goyal, Stefan Hajnoczi, Miklos Szeredi
  Cc: Arnd Bergmann, Dan Williams, Jane Chu, Mathieu Desnoyers,
	virtualization, linux-fsdevel, linux-kernel

From: Arnd Bergmann <arnd@arndb.de>

Calling an __exit function from an __init function is not allowed
and will result in undefined behavior when the code is built-in:

WARNING: modpost: vmlinux: section mismatch in reference: virtio_fs_init+0x50 (section: .init.text) -> virtio_fs_sysfs_exit (section: .exit.text)

Remove the incorrect annotation.

Fixes: a8f62f50b4e4 ("virtiofs: export filesystem tags through sysfs")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 fs/fuse/virtio_fs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/fuse/virtio_fs.c b/fs/fuse/virtio_fs.c
index 3a7dd48b534f..36d87dd3cb48 100644
--- a/fs/fuse/virtio_fs.c
+++ b/fs/fuse/virtio_fs.c
@@ -1595,7 +1595,7 @@ static int __init virtio_fs_sysfs_init(void)
 	return 0;
 }
 
-static void __exit virtio_fs_sysfs_exit(void)
+static void virtio_fs_sysfs_exit(void)
 {
 	kset_unregister(virtio_fs_kset);
 	virtio_fs_kset = NULL;
-- 
2.39.2


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] virtiofs: don't mark virtio_fs_sysfs_exit as __exit
  2024-02-28 21:46 [PATCH] virtiofs: don't mark virtio_fs_sysfs_exit as __exit Arnd Bergmann
@ 2024-02-28 22:23 ` Stefan Hajnoczi
  0 siblings, 0 replies; 2+ messages in thread
From: Stefan Hajnoczi @ 2024-02-28 22:23 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Vivek Goyal, Stefan Hajnoczi, Miklos Szeredi, Arnd Bergmann,
	Dan Williams, Jane Chu, Mathieu Desnoyers, virtualization,
	linux-fsdevel, linux-kernel

On Wed, 28 Feb 2024 at 16:47, Arnd Bergmann <arnd@kernel.org> wrote:
>
> From: Arnd Bergmann <arnd@arndb.de>
>
> Calling an __exit function from an __init function is not allowed
> and will result in undefined behavior when the code is built-in:
>
> WARNING: modpost: vmlinux: section mismatch in reference: virtio_fs_init+0x50 (section: .init.text) -> virtio_fs_sysfs_exit (section: .exit.text)
>
> Remove the incorrect annotation.
>
> Fixes: a8f62f50b4e4 ("virtiofs: export filesystem tags through sysfs")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
>  fs/fuse/virtio_fs.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Thanks, Arnd. Please see the duplicate patch that Miklos applied:
https://lore.kernel.org/linux-fsdevel/CAJfpegsjcZ-dnZYft3B5GBGCntmDR6R1n8PM5YCLmW9FJy1DEw@mail.gmail.com/T/#t

Stefan

>
> diff --git a/fs/fuse/virtio_fs.c b/fs/fuse/virtio_fs.c
> index 3a7dd48b534f..36d87dd3cb48 100644
> --- a/fs/fuse/virtio_fs.c
> +++ b/fs/fuse/virtio_fs.c
> @@ -1595,7 +1595,7 @@ static int __init virtio_fs_sysfs_init(void)
>         return 0;
>  }
>
> -static void __exit virtio_fs_sysfs_exit(void)
> +static void virtio_fs_sysfs_exit(void)
>  {
>         kset_unregister(virtio_fs_kset);
>         virtio_fs_kset = NULL;
> --
> 2.39.2
>
>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-02-28 22:23 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-02-28 21:46 [PATCH] virtiofs: don't mark virtio_fs_sysfs_exit as __exit Arnd Bergmann
2024-02-28 22:23 ` Stefan Hajnoczi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).