From mboxrd@z Thu Jan 1 00:00:00 1970 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 41C7231619A; Mon, 13 Apr 2026 16:51:49 +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=1776099109; cv=none; b=p+fM3v8yCR0TZSd4eACZOMbp6u6Yt4DFgmZAJL+PccEgpu2CypaVL8lBQ49KzIe9veXNFjg3Iik4mSzpghuWSNHkWETOqCmubnNsZRF010YRv868Sj4RZo8v4jdeyW0jFXi5Yxk+WfV6/a6sNnaZK1+wpLXVrTP9CI16H5iXwuI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776099109; c=relaxed/simple; bh=bn12ZlvFZmjOunW7PxY/KH8EOJObFxTfS2JuA2On6pc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=n+2WgGG/ikTs9OWWcbUe9giWtVZH3TyHXYBdrfC9D3Qcnp3QGqAry0Yapbsy2PyWMuSO/beVuQl0ZstVqxUNu9/xWd+xfB3YK1AiPTNYU5oS05vL/pCwyj0p26yD7cXY09U5M4XNrZWjO0YL9ntq7nhBc5Hm3LU0GRhILpdiTNY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=z7VLe3Dj; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="z7VLe3Dj" Received: by smtp.kernel.org (Postfix) with ESMTPSA id CE005C2BCAF; Mon, 13 Apr 2026 16:51:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1776099109; bh=bn12ZlvFZmjOunW7PxY/KH8EOJObFxTfS2JuA2On6pc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=z7VLe3DjwRazTyJsd3MMQIUoDbOiCsx6u+hz+zf2zp6hMlCTAaWKGTKHPaAV7Os6y LZ1j4TsfqO/GA5sDm4oifNyC48vf3N/KOKXkEAnsgij315YphM1tNGfIj/Xa2JCEAC SQtq0lJ2AEKc2+Z9ue6LKQO8/K02/zyShiOYIT04= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Tom Rix , Jeff Layton , Chuck Lever , Sasha Levin Subject: [PATCH 5.10 182/491] nfsd: define exports_proc_ops with CONFIG_PROC_FS Date: Mon, 13 Apr 2026 17:57:07 +0200 Message-ID: <20260413155825.874894020@linuxfoundation.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260413155819.042779211@linuxfoundation.org> References: <20260413155819.042779211@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 5.10-stable review patch. If anyone has any objections, please let me know. ------------------ From: Tom Rix [ Upstream commit 340086da9a87820b40601141a0e9e87c954ac006 ] gcc with W=1 and ! CONFIG_PROC_FS fs/nfsd/nfsctl.c:161:30: error: ‘exports_proc_ops’ defined but not used [-Werror=unused-const-variable=] 161 | static const struct proc_ops exports_proc_ops = { | ^~~~~~~~~~~~~~~~ The only use of exports_proc_ops is when CONFIG_PROC_FS is defined, so its definition should be likewise conditional. Signed-off-by: Tom Rix Reviewed-by: Jeff Layton Signed-off-by: Chuck Lever Stable-dep-of: e7fcf179b82d ("NFSD: Hold net reference for the lifetime of /proc/fs/nfs/exports fd") Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- fs/nfsd/nfsctl.c | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) --- a/fs/nfsd/nfsctl.c +++ b/fs/nfsd/nfsctl.c @@ -155,18 +155,6 @@ static int exports_net_open(struct net * return 0; } -static int exports_proc_open(struct inode *inode, struct file *file) -{ - return exports_net_open(current->nsproxy->net_ns, file); -} - -static const struct proc_ops exports_proc_ops = { - .proc_open = exports_proc_open, - .proc_read = seq_read, - .proc_lseek = seq_lseek, - .proc_release = seq_release, -}; - static int exports_nfsd_open(struct inode *inode, struct file *file) { return exports_net_open(inode->i_sb->s_fs_info, file); @@ -1423,6 +1411,19 @@ static struct file_system_type nfsd_fs_t MODULE_ALIAS_FS("nfsd"); #ifdef CONFIG_PROC_FS + +static int exports_proc_open(struct inode *inode, struct file *file) +{ + return exports_net_open(current->nsproxy->net_ns, file); +} + +static const struct proc_ops exports_proc_ops = { + .proc_open = exports_proc_open, + .proc_read = seq_read, + .proc_lseek = seq_lseek, + .proc_release = seq_release, +}; + static int create_proc_exports_entry(void) { struct proc_dir_entry *entry;