diff mbox series

[3/3] nfs: show dynamic nconnect

Message ID 20211115165818.2583501-3-Anna.Schumaker@Netapp.com (mailing list archive)
State New, archived
Headers show
Series [1/3] sunrpc: Fix potential race conditions in rpc_sysfs_xprt_state_change() | expand

Commit Message

Anna Schumaker Nov. 15, 2021, 4:58 p.m. UTC
From: Anna Schumaker <Anna.Schumaker@Netapp.com>

Through sysfs we can change the number of xprts attached to an
rpc_client. This lets us change the displayed nconnect= value to reflect
the actual number of connected xprts for the given mount.

Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
---
 fs/nfs/super.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/fs/nfs/super.c b/fs/nfs/super.c
index 3aced401735c..f6ede7bf18f9 100644
--- a/fs/nfs/super.c
+++ b/fs/nfs/super.c
@@ -478,7 +478,7 @@  static void nfs_show_mount_options(struct seq_file *m, struct nfs_server *nfss,
 		   rpc_peeraddr2str(nfss->client, RPC_DISPLAY_NETID));
 	rcu_read_unlock();
 	if (clp->cl_nconnect > 0)
-		seq_printf(m, ",nconnect=%u", clp->cl_nconnect);
+		seq_printf(m, ",nconnect=%u", rpc_clnt_xprt_switch_num_xprts(clp->cl_rpcclient));
 	if (version == 4) {
 		if (clp->cl_max_connect > 1)
 			seq_printf(m, ",max_connect=%u", clp->cl_max_connect);