public inbox for linux-nfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Tyler Mitchell <fission@ldx.ca>
To: linux-nfs@vger.kernel.org
Subject: /proc/fs/nfsd/clients/*/info TCP port not updating after reconnect
Date: Mon, 21 Oct 2024 20:42:24 -0700	[thread overview]
Message-ID: <20241022034224.GE2515022@ldx.ca> (raw)

Hi,

I have an NFS server running on Alpine Linux:

# uname -a
Linux charm 6.6.54-0-lts #1-Alpine SMP PREEMPT_DYNAMIC 2024-10-04 16:47:58 x86_64 Linux

I wrote some very simple shell scripts to track & report NFS client
usage. But I noticed that after some time, the TCP port reported in
the "address" field of /proc/fs/nfsd/clients/*/info doesn't match
the actual TCP port in use by the client.

An example from the server side:

# cat /proc/fs/nfsd/clients/4/info
clientid: 0xdf43354e670522ab
address: "192.168.93.218:752"
status: confirmed
seconds from last renew: 60
name: "Linux NFSv4.2 raspberrypi"
minor version: 2
Implementation domain: "kernel.org"
Implementation name: "Linux 6.1.21-v7+ #1642 SMP Mon Apr  3 17:20:52 BST 2023 armv7l"
Implementation time: [0, 0]
callback state: UP
callback address: 192.168.93.218:0
# netstat -n | egrep '(Foreign|:2049)'
Proto Recv-Q Send-Q Local Address           Foreign Address         State
tcp        0      0 192.168.93.82:2049      192.168.93.218:776      ESTABLISHED
tcp        0      0 192.168.93.82:2049      192.168.93.218:752      ESTABLISHED

And on the client:

% netstat -4n
Active Internet connections (w/o servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State
tcp        0      0 192.168.93.218:776      192.168.93.82:2049      ESTABLISHED


When the NFS connection was first established, it was using 752 (I
had checked), but it seems that it got disconnected at some point
and reconnected from port 776. (In this case I was actually doing
some rewiring and the NFS server was temporarily disconnected from
the network.)

The client_info_show() function seems to be just reading the state
data from a struct nfs4_client. And I see this gets populated in
create_client() but I don't see it being updated anywhere. In this
case, it would have to happen after the client reconnects following
a transient error.

Anyhow, I don't have an immediate solution, but wanted to mention
this in case it wasn't already a known issue. Ideally the port
could be updated when it changes so that it's possible to better
track active clients.

Many thanks,
Tyler

                 reply	other threads:[~2024-10-22  3:42 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20241022034224.GE2515022@ldx.ca \
    --to=fission@ldx.ca \
    --cc=linux-nfs@vger.kernel.org \
    /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