Message ID | 20240228214708.611460-1-arnd@kernel.org |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel+bounces-85741-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:6358:a1a:b0:17b:cd04:e0c6 with SMTP id 26csp212650rwa; Wed, 28 Feb 2024 13:47:34 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVrRVHuVt3kcWmqqK7QWV48x142NLk6aHUYmXPXhx0r05iCWPa/zDh0wflEnnSdaCPCSUYp3+F8+jrpUOd+GLCzUr6Bdw== X-Google-Smtp-Source: AGHT+IHK6smloaytgnn8fEHTD1yaKgEEDavylZFR9KC/DrQHw3BpKf+0Goj+PNpQag/g7yQAkr5b X-Received: by 2002:a05:6214:aab:b0:690:1e55:6df7 with SMTP id ew11-20020a0562140aab00b006901e556df7mr333874qvb.25.1709156854395; Wed, 28 Feb 2024 13:47:34 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709156854; cv=pass; d=google.com; s=arc-20160816; b=iEB0ficbtC4GSTq9CXFGu64QipsJL3+yM6vqFp6PeLbpY0FH82k+rca282IM+pVk8f 0LcFMCsuF81OVFXZ1l3/u2T2JLXUPSjzciRtshOrdAhzp8E0Dm4EUqqqlJ2hM4hT2eFS qYjUlvrSMkEKW+Y5UOMXU887jGCTH7WpSs8D451ahFMX6TJBfIMtwKL0csE+z0Kikw5p SsUqXSlqrgc6Qd1f0hlwrnqpZR6rJ7QTtL0IK9cjTh2BCmcSR9VoE8wBrvHZSREl9G0t Dfd8ni/+xc5990vyDaiA38fvD1loMK7UyCQ55bb2kAIIAfTvPpJx2MQz2cSw4K1+IrBF 5rpg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=jCcKhJayF3qKC+MWOoovXcTl4UvkiKF5ftEDCyIL/VI=; fh=3u1qg4IRDmwhRVE25WGt9vWd4dav0gyztZLirCly8NM=; b=lD49M1IkU3JfsRRJ7Wo7kyY7zn0oYxWQpHE4u3hKX8i566NHqNZH8P1D6fjmObhf49 uUmZTt1Yi8kkwAXWdFvRmptAKj/Zt3LZyL7Tw5fIkLE2fzZKz9LpSYaUyeCQ5T5YxJwi IeODNZlLcI1sU+teHksqV/U+IrkrcJOpgMODjDUbizwGq1nmfsCjrY76R6Ag0RXD1vnI QfXA+iAb6InOsP6yXW610UC+HndVHxe9GZhex7uBJP7TiLhyH2xVzJ3s8cyB4GPBXTfA WLWKozpjdBd52ojTVugibBaYnu9IabTCdIOfFtUD9SUoCfpazJQcmkPZ2HGN8JiECqNR ReTQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=NBLT9KkY; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-85741-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-85741-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id pg9-20020a0562144a0900b006903eba5044si22754qvb.112.2024.02.28.13.47.34 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Feb 2024 13:47:34 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-85741-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=NBLT9KkY; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-85741-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-85741-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 2CE1E1C22247 for <ouuuleilei@gmail.com>; Wed, 28 Feb 2024 21:47:34 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 558A77290E; Wed, 28 Feb 2024 21:47:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="NBLT9KkY" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A04D13FB97; Wed, 28 Feb 2024 21:47:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709156835; cv=none; b=lrdt9zr/b56WOXfs65G+cw1+Cczg7Jzq1qER/bxb54T3Ea7LrwxPBQh001hcy2D3iMie7zji6o1NGLAQ+ugIQzgdmVSHkaUbQJg+Vs11me0LIX3647G7x/OXeCmFZkYrrfGS6aNCI1ln+bojMv3zwvEj3BK56hyEtZ+wvOOx7ic= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709156835; c=relaxed/simple; bh=sxZkuOb7q4tDGVwfQR84w+qL7n5xeOeJqnEC5GcENck=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=tBlJc7lCL1eFlOraO1pY/2/E2c582m/nhR1ymZxn89tgCImcq4XkBnTmzHU2eP2LPlsBM4TR86mduuLQaCe7+0vCoDmx3/ZqMk0XiFwdT8xFy3EHMu8WKigyb+MzN+lnu1bZbRuyGQapD/fmPri/xSw6PObx6o69PoAxBMPKIbM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=NBLT9KkY; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id DACC0C433F1; Wed, 28 Feb 2024 21:47:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1709156835; bh=sxZkuOb7q4tDGVwfQR84w+qL7n5xeOeJqnEC5GcENck=; h=From:To:Cc:Subject:Date:From; b=NBLT9KkYzdKS7QSnvZ7KA72L3EpUiVoxlKlVr2PbI6c1Ufti5h2DT5m8VvAKzchcV u5bK2BpSOkOsH4pn7khd/2M4ASoElLqATSSx0MCTGgWekJ0+bsC4ecbtBCLHp69JiD vktpr9Gt00Ba2mBXfO4M0a/0TZRemDSmMk082t1lDNrZPOOQRHvYvkVQHAPG2JVqFo 11Z63fk2hWSazvSjPl5/nymWcwCmtaWHbdhHE+m4ucNoh0214aaY2DNigqLUAvtoa9 /C86MauACM1Kh6yO+ycdxrE7icjc1EF+lmYWXtZMSs0dQs2XM9vaCoTcPxJQiT9bxc VUDkEmADftTwg== From: Arnd Bergmann <arnd@kernel.org> To: Vivek Goyal <vgoyal@redhat.com>, Stefan Hajnoczi <stefanha@redhat.com>, Miklos Szeredi <miklos@szeredi.hu> Cc: Arnd Bergmann <arnd@arndb.de>, Dan Williams <dan.j.williams@intel.com>, Jane Chu <jane.chu@oracle.com>, Mathieu Desnoyers <mathieu.desnoyers@efficios.com>, virtualization@lists.linux.dev, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] virtiofs: don't mark virtio_fs_sysfs_exit as __exit Date: Wed, 28 Feb 2024 22:46:59 +0100 Message-Id: <20240228214708.611460-1-arnd@kernel.org> X-Mailer: git-send-email 2.39.2 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: <linux-kernel.vger.kernel.org> List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org> List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1792180857847687684 X-GMAIL-MSGID: 1792180857847687684 |
Series |
virtiofs: don't mark virtio_fs_sysfs_exit as __exit
|
|
Commit Message
Arnd Bergmann
Feb. 28, 2024, 9:46 p.m. UTC
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(-)
Comments
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 > >
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;