linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Jeff Layton <jlayton@kernel.org>
To: Christian Brauner <brauner@kernel.org>,
	 Alexander Viro <viro@zeniv.linux.org.uk>,
	 Chuck Lever <chuck.lever@oracle.com>,
	NeilBrown <neil@brown.name>,
	 Olga Kornievskaia <okorniev@redhat.com>,
	Dai Ngo <Dai.Ngo@oracle.com>,  Tom Talpey <tom@talpey.com>,
	Amir Goldstein <amir73il@gmail.com>,
	 Hugh Dickins <hughd@google.com>,
	 Baolin Wang <baolin.wang@linux.alibaba.com>,
	 Andrew Morton <akpm@linux-foundation.org>,
	Theodore Ts'o <tytso@mit.edu>,
	 Andreas Dilger <adilger.kernel@dilger.ca>,
	Jan Kara <jack@suse.com>,  Gao Xiang <xiang@kernel.org>,
	Chao Yu <chao@kernel.org>,  Yue Hu <zbestahu@gmail.com>,
	Jeffle Xu <jefflexu@linux.alibaba.com>,
	 Sandeep Dhavale <dhavale@google.com>,
	Hongbo Li <lihongbo22@huawei.com>,
	 Chunhai Guo <guochunhai@vivo.com>,
	Carlos Maiolino <cem@kernel.org>,
	 Ilya Dryomov <idryomov@gmail.com>,
	Alex Markuze <amarkuze@redhat.com>,
	 Viacheslav Dubeyko <slava@dubeyko.com>, Chris Mason <clm@fb.com>,
	 David Sterba <dsterba@suse.com>,
	Luis de Bethencourt <luisbg@kernel.org>,
	 Salah Triki <salah.triki@gmail.com>,
	 Phillip Lougher <phillip@squashfs.org.uk>,
	Steve French <sfrench@samba.org>,
	 Paulo Alcantara <pc@manguebit.org>,
	 Ronnie Sahlberg <ronniesahlberg@gmail.com>,
	 Shyam Prasad N <sprasad@microsoft.com>,
	 Bharath SM <bharathsm@microsoft.com>,
	Miklos Szeredi <miklos@szeredi.hu>,
	 Mike Marshall <hubcap@omnibond.com>,
	 Martin Brandenburg <martin@omnibond.com>,
	Mark Fasheh <mark@fasheh.com>,  Joel Becker <jlbec@evilplan.org>,
	Joseph Qi <joseph.qi@linux.alibaba.com>,
	 Konstantin Komarov <almaz.alexandrovich@paragon-software.com>,
	 Ryusuke Konishi <konishi.ryusuke@gmail.com>,
	 Trond Myklebust <trondmy@kernel.org>,
	Anna Schumaker <anna@kernel.org>,
	 Dave Kleikamp <shaggy@kernel.org>,
	David Woodhouse <dwmw2@infradead.org>,
	 Richard Weinberger <richard@nod.at>, Jan Kara <jack@suse.cz>,
	 Andreas Gruenbacher <agruenba@redhat.com>,
	 OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>,
	 Jaegeuk Kim <jaegeuk@kernel.org>,
	Jonathan Corbet <corbet@lwn.net>
Cc: David Laight <david.laight.linux@gmail.com>,
	 Dave Chinner <david@fromorbit.com>,
	Christoph Hellwig <hch@infradead.org>,
	 linux-nfs@vger.kernel.org, linux-kernel@vger.kernel.org,
	 linux-fsdevel@vger.kernel.org, linux-mm@kvack.org,
	 linux-ext4@vger.kernel.org, linux-erofs@lists.ozlabs.org,
	 linux-xfs@vger.kernel.org, ceph-devel@vger.kernel.org,
	 linux-btrfs@vger.kernel.org, linux-cifs@vger.kernel.org,
	 samba-technical@lists.samba.org, linux-unionfs@vger.kernel.org,
	 devel@lists.orangefs.org, ocfs2-devel@lists.linux.dev,
	 ntfs3@lists.linux.dev, linux-nilfs@vger.kernel.org,
	 jfs-discussion@lists.sourceforge.net,
	linux-mtd@lists.infradead.org,  gfs2@lists.linux.dev,
	linux-f2fs-devel@lists.sourceforge.net,
	 linux-doc@vger.kernel.org, Jeff Layton <jlayton@kernel.org>
Subject: [PATCH v2 31/31] nfsd: convert dprintks in check_export() to tracepoints
Date: Mon, 19 Jan 2026 11:26:48 -0500	[thread overview]
Message-ID: <20260119-exportfs-nfsd-v2-31-d93368f903bd@kernel.org> (raw)
In-Reply-To: <20260119-exportfs-nfsd-v2-0-d93368f903bd@kernel.org>

Get rid of the dprintk messages in check_export(). Instead add new
tracepoints that show the terminal inode and the flags.

Signed-off-by: Jeff Layton <jlayton@kernel.org>
---
 fs/nfsd/export.c | 11 ++++++-----
 fs/nfsd/trace.h  | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 58 insertions(+), 5 deletions(-)

diff --git a/fs/nfsd/export.c b/fs/nfsd/export.c
index bc703cf58bfa210c7c57d49f22f15bc10d7cfc91..3cc336b953b38573966c43000f31cd341380837b 100644
--- a/fs/nfsd/export.c
+++ b/fs/nfsd/export.c
@@ -435,31 +435,32 @@ static int check_export(const struct path *path, int *flags, unsigned char *uuid
 	if (!(inode->i_sb->s_type->fs_flags & FS_REQUIRES_DEV) &&
 	    !(*flags & NFSEXP_FSID) &&
 	    uuid == NULL) {
-		dprintk("exp_export: export of non-dev fs without fsid\n");
+		trace_nfsd_check_export_need_fsid(inode, *flags);
 		return -EINVAL;
 	}
 
 	if (!exportfs_can_decode_fh(inode->i_sb->s_export_op)) {
-		dprintk("exp_export: export of invalid fs type.\n");
+		trace_nfsd_check_export_invalid_fstype(inode, *flags);
 		return -EINVAL;
 	}
 
 	if (!(inode->i_sb->s_export_op->flags & EXPORT_OP_STABLE_HANDLES)) {
-		dprintk("%s: fs does not provide stable filehandles!\n", __func__);
+		trace_nfsd_check_export_no_stable_fh(inode, *flags);
 		return -EINVAL;
 	}
 
 	if (is_idmapped_mnt(path->mnt)) {
 		dprintk("exp_export: export of idmapped mounts not yet supported.\n");
+		trace_nfsd_check_export_idmapped(inode, *flags);
 		return -EINVAL;
 	}
 
 	if (inode->i_sb->s_export_op->flags & EXPORT_OP_NOSUBTREECHK &&
 	    !(*flags & NFSEXP_NOSUBTREECHECK)) {
-		dprintk("%s: %s does not support subtree checking!\n",
-			__func__, inode->i_sb->s_type->name);
+		trace_nfsd_check_export_subtree(inode, *flags);
 		return -EINVAL;
 	}
+	trace_nfsd_check_export_success(inode, *flags);
 	return 0;
 }
 
diff --git a/fs/nfsd/trace.h b/fs/nfsd/trace.h
index 5ae2a611e57f4b4e51a4d9eb6e0fccb66ad8d288..e3f5fe1181b605b34cb70d53f32739c3ef9b82f6 100644
--- a/fs/nfsd/trace.h
+++ b/fs/nfsd/trace.h
@@ -339,6 +339,58 @@ DEFINE_EVENT_CONDITION(nfsd_fh_err_class, nfsd_##name,	\
 DEFINE_NFSD_FH_ERR_EVENT(set_fh_dentry_badexport);
 DEFINE_NFSD_FH_ERR_EVENT(set_fh_dentry_badhandle);
 
+#define show_export_flags(val)						\
+	__print_flags(val, "|",						\
+		{ NFSEXP_READONLY,		"READONLY" },		\
+		{ NFSEXP_INSECURE_PORT,		"INSECURE" },		\
+		{ NFSEXP_ROOTSQUASH,		"ROOTSQUASH" },		\
+		{ NFSEXP_ALLSQUASH,		"ALLSQUASH" },		\
+		{ NFSEXP_ASYNC,			"ASYNC" },		\
+		{ NFSEXP_GATHERED_WRITES,	"GATHERED_WRITES" },	\
+		{ NFSEXP_NOREADDIRPLUS,		"NOREADDIRPLUS" },	\
+		{ NFSEXP_SECURITY_LABEL,	"SECURITY_LABEL" },	\
+		{ NFSEXP_NOHIDE,		"NOHIDE" },		\
+		{ NFSEXP_NOSUBTREECHECK,	"NOSUBTREECHECK" },	\
+		{ NFSEXP_NOAUTHNLM,		"NOAUTHNLM" },		\
+		{ NFSEXP_MSNFS,			"MSNFS" },		\
+		{ NFSEXP_FSID,			"FSID" },		\
+		{ NFSEXP_CROSSMOUNT,		"CROSSMOUNT" },		\
+		{ NFSEXP_NOACL,			"NOACL" },		\
+		{ NFSEXP_V4ROOT,		"V4ROOT" },		\
+		{ NFSEXP_PNFS,			"PNFS" })
+
+DECLARE_EVENT_CLASS(nfsd_check_export_class,
+	TP_PROTO(const struct inode *inode,
+		 int flags),
+	TP_ARGS(inode, flags),
+	TP_STRUCT__entry(
+		__field(dev_t, dev)
+		__field(ino_t, ino)
+		__field(int, flags)
+	),
+	TP_fast_assign(
+		__entry->dev = inode->i_sb->s_dev;
+		__entry->ino = inode->i_ino;
+		__entry->flags = flags;
+	),
+	TP_printk("dev=%u:%u:%lu flags=%s",
+		  MAJOR(__entry->dev), MINOR(__entry->dev),
+		  __entry->ino, show_export_flags(__entry->flags))
+)
+
+#define DEFINE_NFSD_CHECK_EXPORT_EVENT(name)			\
+DEFINE_EVENT(nfsd_check_export_class, nfsd_check_export_##name,	\
+	TP_PROTO(const struct inode *inode,			\
+		 int flags),					\
+	TP_ARGS(inode, flags))
+
+DEFINE_NFSD_CHECK_EXPORT_EVENT(need_fsid);
+DEFINE_NFSD_CHECK_EXPORT_EVENT(invalid_fstype);
+DEFINE_NFSD_CHECK_EXPORT_EVENT(no_stable_fh);
+DEFINE_NFSD_CHECK_EXPORT_EVENT(idmapped);
+DEFINE_NFSD_CHECK_EXPORT_EVENT(subtree);
+DEFINE_NFSD_CHECK_EXPORT_EVENT(success);
+
 TRACE_EVENT(nfsd_exp_find_key,
 	TP_PROTO(const struct svc_expkey *key,
 		 int status),

-- 
2.52.0



  parent reply	other threads:[~2026-01-19 16:31 UTC|newest]

Thread overview: 50+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-19 16:26 [PATCH v2 00/31] fs: require filesystems to explicitly opt-in to nfsd export support Jeff Layton
2026-01-19 16:26 ` [PATCH v2 01/31] Documentation: document EXPORT_OP_NOLOCKS Jeff Layton
2026-01-20  7:44   ` Christoph Hellwig
2026-01-20 13:20     ` Jeff Layton
2026-01-20 14:12       ` Jeff Layton
2026-01-20 14:35         ` Jeff Layton
2026-01-21  9:17           ` Christoph Hellwig
2026-01-21  9:58           ` NeilBrown
2026-01-21 12:29             ` Jeff Layton
2026-01-21 22:47               ` NeilBrown
2026-01-19 16:26 ` [PATCH v2 02/31] exportfs: add new EXPORT_OP_STABLE_HANDLES flag Jeff Layton
2026-01-19 16:41   ` Amir Goldstein
2026-01-20  7:50   ` Christoph Hellwig
2026-01-20  8:40     ` Jan Kara
2026-01-21  9:17       ` Christoph Hellwig
2026-01-20 13:21     ` Jeff Layton
2026-01-19 16:26 ` [PATCH v2 03/31] tmpfs: add EXPORT_OP_STABLE_HANDLES flag to export operations Jeff Layton
2026-01-19 16:26 ` [PATCH v2 04/31] ext4: " Jeff Layton
2026-01-19 16:26 ` [PATCH v2 05/31] ext2: " Jeff Layton
2026-01-19 16:26 ` [PATCH v2 06/31] erofs: " Jeff Layton
2026-01-19 16:26 ` [PATCH v2 07/31] efs: " Jeff Layton
2026-01-19 16:26 ` [PATCH v2 08/31] xfs: " Jeff Layton
2026-01-19 16:26 ` [PATCH v2 09/31] ceph: " Jeff Layton
2026-01-19 16:26 ` [PATCH v2 10/31] btrfs: " Jeff Layton
2026-01-19 16:26 ` [PATCH v2 11/31] befs: " Jeff Layton
2026-01-19 16:26 ` [PATCH v2 12/31] ufs: " Jeff Layton
2026-01-19 16:26 ` [PATCH v2 13/31] udf: " Jeff Layton
2026-01-19 16:26 ` [PATCH v2 14/31] affs: " Jeff Layton
2026-01-19 16:26 ` [PATCH v2 15/31] squashfs: " Jeff Layton
2026-01-19 16:26 ` [PATCH v2 16/31] smb/client: " Jeff Layton
2026-01-19 16:26 ` [PATCH v2 17/31] ovl: " Jeff Layton
2026-01-19 16:42   ` Amir Goldstein
2026-01-19 16:26 ` [PATCH v2 18/31] orangefs: " Jeff Layton
2026-01-19 16:26 ` [PATCH v2 19/31] ocfs2: " Jeff Layton
2026-01-19 16:26 ` [PATCH v2 20/31] ntfs3: " Jeff Layton
2026-01-19 16:26 ` [PATCH v2 21/31] nilfs2: " Jeff Layton
2026-01-19 16:26 ` [PATCH v2 22/31] nfs: " Jeff Layton
2026-01-19 16:26 ` [PATCH v2 23/31] jfs: " Jeff Layton
2026-01-19 16:26 ` [PATCH v2 24/31] jffs2: " Jeff Layton
2026-01-19 16:26 ` [PATCH v2 25/31] isofs: " Jeff Layton
2026-01-19 16:26 ` [PATCH v2 26/31] gfs2: " Jeff Layton
2026-01-19 16:26 ` [PATCH v2 27/31] fuse: " Jeff Layton
2026-01-19 16:43   ` Amir Goldstein
2026-01-19 16:26 ` [PATCH v2 28/31] fat: " Jeff Layton
2026-01-19 16:26 ` [PATCH v2 29/31] f2fs: " Jeff Layton
2026-01-19 16:26 ` [PATCH v2 30/31] nfsd: only allow filesystems that set EXPORT_OP_STABLE_HANDLES Jeff Layton
2026-01-19 16:51   ` Chuck Lever
2026-01-19 16:26 ` Jeff Layton [this message]
2026-01-19 16:47   ` [PATCH v2 31/31] nfsd: convert dprintks in check_export() to tracepoints Chuck Lever
2026-01-20 13:42     ` Jeff Layton

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260119-exportfs-nfsd-v2-31-d93368f903bd@kernel.org \
    --to=jlayton@kernel.org \
    --cc=Dai.Ngo@oracle.com \
    --cc=adilger.kernel@dilger.ca \
    --cc=agruenba@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=almaz.alexandrovich@paragon-software.com \
    --cc=amarkuze@redhat.com \
    --cc=amir73il@gmail.com \
    --cc=anna@kernel.org \
    --cc=baolin.wang@linux.alibaba.com \
    --cc=bharathsm@microsoft.com \
    --cc=brauner@kernel.org \
    --cc=cem@kernel.org \
    --cc=ceph-devel@vger.kernel.org \
    --cc=chao@kernel.org \
    --cc=chuck.lever@oracle.com \
    --cc=clm@fb.com \
    --cc=corbet@lwn.net \
    --cc=david.laight.linux@gmail.com \
    --cc=david@fromorbit.com \
    --cc=devel@lists.orangefs.org \
    --cc=dhavale@google.com \
    --cc=dsterba@suse.com \
    --cc=dwmw2@infradead.org \
    --cc=gfs2@lists.linux.dev \
    --cc=guochunhai@vivo.com \
    --cc=hch@infradead.org \
    --cc=hirofumi@mail.parknet.co.jp \
    --cc=hubcap@omnibond.com \
    --cc=hughd@google.com \
    --cc=idryomov@gmail.com \
    --cc=jack@suse.com \
    --cc=jack@suse.cz \
    --cc=jaegeuk@kernel.org \
    --cc=jefflexu@linux.alibaba.com \
    --cc=jfs-discussion@lists.sourceforge.net \
    --cc=jlbec@evilplan.org \
    --cc=joseph.qi@linux.alibaba.com \
    --cc=konishi.ryusuke@gmail.com \
    --cc=lihongbo22@huawei.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=linux-cifs@vger.kernel.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-erofs@lists.ozlabs.org \
    --cc=linux-ext4@vger.kernel.org \
    --cc=linux-f2fs-devel@lists.sourceforge.net \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=linux-nfs@vger.kernel.org \
    --cc=linux-nilfs@vger.kernel.org \
    --cc=linux-unionfs@vger.kernel.org \
    --cc=linux-xfs@vger.kernel.org \
    --cc=luisbg@kernel.org \
    --cc=mark@fasheh.com \
    --cc=martin@omnibond.com \
    --cc=miklos@szeredi.hu \
    --cc=neil@brown.name \
    --cc=ntfs3@lists.linux.dev \
    --cc=ocfs2-devel@lists.linux.dev \
    --cc=okorniev@redhat.com \
    --cc=pc@manguebit.org \
    --cc=phillip@squashfs.org.uk \
    --cc=richard@nod.at \
    --cc=ronniesahlberg@gmail.com \
    --cc=salah.triki@gmail.com \
    --cc=samba-technical@lists.samba.org \
    --cc=sfrench@samba.org \
    --cc=shaggy@kernel.org \
    --cc=slava@dubeyko.com \
    --cc=sprasad@microsoft.com \
    --cc=tom@talpey.com \
    --cc=trondmy@kernel.org \
    --cc=tytso@mit.edu \
    --cc=viro@zeniv.linux.org.uk \
    --cc=xiang@kernel.org \
    --cc=zbestahu@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox