mount options not propagating to NFSACL and NSM RPC clients

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

On Linux v6.6-14500-g1c41041124bd, I added a sysfs file for debugging
`/sys/kernel/debug/sunrpc/rpc_clnt/*/info`, and noticed that when
passing the following mount options: `soft,timeo=50,retrans=16,vers=3`,
NFSACL and NSM seem to take the defaults from somewhere else (xprt).
Specifically, locking operation behave as if in a hard mount with
these mount options.

Is it intentional?

    cl_prog: 100000
    cl_softrtry: 1
    cl_timeout: to_initval=10000, to_maxval=10000, to_increment=0, to_retries=2, to_exponential=0

    cl_prog: 100003
    cl_softrtry: 1
    cl_timeout: to_initval=5000, to_maxval=85000, to_increment=5000, to_retries=16, to_exponential=0

    cl_prog: 100000
    cl_softrtry: 1
    cl_timeout: to_initval=10000, to_maxval=10000, to_increment=0, to_retries=2, to_exponential=0

    cl_prog: 100021
    cl_softrtry: 0
    cl_timeout: to_initval=10000, to_maxval=60000, to_increment=10000, to_retries=5, to_exponential=0

    cl_prog: 100003
    cl_softrtry: 1
    cl_timeout: to_initval=5000, to_maxval=85000, to_increment=5000, to_retries=16, to_exponential=0

    cl_prog: 100227
    cl_softrtry: 1
    cl_timeout: to_initval=60000, to_maxval=60000, to_increment=0, to_retries=2, to_exponential=0
    

Also, here's the patch I used to expose this information:

-- >8 --
Subject: [PATCH] sunrpc: add per-client 'info' node in debugfs

---
 net/sunrpc/debugfs.c | 75 ++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 75 insertions(+)

diff --git a/net/sunrpc/debugfs.c b/net/sunrpc/debugfs.c
index a176d5a0b0ee..61a2cc01815d 100644
--- a/net/sunrpc/debugfs.c
+++ b/net/sunrpc/debugfs.c
@@ -142,6 +142,77 @@ static int do_xprt_debugfs(struct rpc_clnt *clnt, struct rpc_xprt *xprt, void *n
 	return 0;
 }
 
+static int
+clnt_info_show(struct seq_file *seq, void *v)
+{
+	struct rpc_clnt *clnt = seq->private;
+	const struct rpc_timeout *timeout = clnt->cl_timeout;
+
+	seq_printf(seq, "cl_count: %d\n", refcount_read(&clnt->cl_count));
+	seq_printf(seq, "cl_pid: %d\n", atomic_read(&clnt->cl_pid));
+	seq_printf(seq, "cl_prog: %d\n", clnt->cl_prog);
+	seq_printf(seq, "cl_vers: %d\n", clnt->cl_vers);
+	seq_printf(seq, "cl_maxproc: %d\n", clnt->cl_maxproc);
+
+	seq_printf(seq, "cl_softrtry: %d\n", clnt->cl_softrtry);
+	seq_printf(seq, "cl_softerr: %d\n", clnt->cl_softerr);
+	seq_printf(seq, "cl_discrtry: %d\n", clnt->cl_discrtry);
+	seq_printf(seq, "cl_noretranstimeo: %d\n", clnt->cl_noretranstimeo);
+	seq_printf(seq, "cl_autobind: %d\n", clnt->cl_autobind);
+	seq_printf(seq, "cl_chatty: %d\n", clnt->cl_chatty);
+	seq_printf(seq, "cl_shutdown: %d\n", clnt->cl_shutdown);
+
+	seq_printf(seq, "cl_xprtsec: %d\n", clnt->cl_xprtsec.policy);
+	seq_printf(seq, "cl_rtt: timeo=%ld\n", clnt->cl_rtt->timeo);
+	seq_printf(seq, "cl_timeout: "
+		   "to_initval=%ld, to_maxval=%ld, to_increment=%ld, "
+		   "to_retries=%d, to_exponential=%d\n",
+		   timeout->to_initval, timeout->to_maxval,
+		   timeout->to_increment,
+		   timeout->to_retries, timeout->to_exponential);
+
+	seq_printf(seq, "cl_max_connect: %d\n", clnt->cl_max_connect);
+	seq_printf(seq, "cl_nodename: ");
+	seq_write(seq, clnt->cl_nodename, clnt->cl_nodelen);
+	seq_printf(seq, "\n");
+
+	return 0;
+}
+
+static int
+clnt_info_open(struct inode *inode, struct file *filp)
+{
+	int ret;
+	struct rpc_clnt *clnt = inode->i_private;
+
+	ret = single_open(filp, clnt_info_show, clnt);
+
+	if (!ret && !refcount_inc_not_zero(&clnt->cl_count)) {
+		single_release(inode, filp);
+		return -EINVAL;
+	}
+
+	return ret;
+}
+
+static int
+clnt_info_release(struct inode *inode, struct file *filp)
+{
+	struct seq_file *seq = filp->private_data;
+	struct rpc_clnt *clnt = seq->private;
+
+	rpc_release_client(clnt);
+	return seq_release(inode, filp);
+}
+
+static const struct file_operations info_fops = {
+	.owner		= THIS_MODULE,
+	.open		= clnt_info_open,
+	.read		= seq_read,
+	.llseek		= seq_lseek,
+	.release	= clnt_info_release,
+};
+
 void
 rpc_clnt_debugfs_register(struct rpc_clnt *clnt)
 {
@@ -160,6 +231,10 @@ rpc_clnt_debugfs_register(struct rpc_clnt *clnt)
 	debugfs_create_file("tasks", S_IFREG | 0400, clnt->cl_debugfs, clnt,
 			    &tasks_fops);
 
+	/* make info file */
+	debugfs_create_file("info", S_IFREG | 0400, clnt->cl_debugfs, clnt,
+			    &info_fops);
+
 	rpc_clnt_iterate_for_each_xprt(clnt, do_xprt_debugfs, &xprtnum);
 }
 
-- 
2.39.3


-- 
Dan Aloni



[Index of Archives]     [Linux Filesystem Development]     [Linux USB Development]     [Linux Media Development]     [Video for Linux]     [Linux NILFS]     [Linux Audio Users]     [Yosemite Info]     [Linux SCSI]

  Powered by Linux