Bug 215526 - noresvport + nfsv4 no longer working as expected
Summary: noresvport + nfsv4 no longer working as expected
Status: NEW
Alias: None
Product: File System
Classification: Unclassified
Component: NFS (show other bugs)
Hardware: All Linux
: P1 normal
Assignee: Trond Myklebust
Depends on:
Reported: 2022-01-24 12:30 UTC by Daire Byrne
Modified: 2022-02-14 10:09 UTC (History)
2 users (show)

See Also:
Kernel Version: 5.12+
Tree: Mainline
Regression: No


Description Daire Byrne 2022-01-24 12:30:46 UTC

When mounting with "-o vers=4.2,noresvport", it seems to be ignored such that the client still uses a reserved port (or ports with nconnect).

It still works as expected when doing "-o vers=3,noresvport".

A very quick test of some kernels I had prebuilt suggests this stopped working somewhere between 5.11.11 and 5.12.19. That might make it one of:

    * tag 'nfs-for-5.12-2' of git://git.linux-nfs.org/projects/anna/linux-nfs:
      nfs: we don't support removing system.nfs4_acl
      NFSv4.2: fix return value of _nfs4_get_security_label()
      NFS: Fix open coded versions of nfs_set_cache_invalid() in NFSv4
      NFS: Fix open coded versions of nfs_set_cache_invalid()
      NFS: Clean up function nfs_mark_dir_for_revalidate()
      NFS: Don't gratuitously clear the inode cache when lookup failed
      NFS: Don't revalidate the directory permissions on a lookup failure
      SUNRPC: Set memalloc_nofs_save() for sync tasks
      NFS: Correct size calculation for create reply length
      nfs: fix PNFS_FLEXFILE_LAYOUT Kconfig default

I will try and get a bisect done this week.

Comment 1 bfields 2022-01-24 14:12:26 UTC
Also in that range and look potentially relevant on a quick skim:

87871d990a2c NFSv4: Initialise connection to the server in nfs4_alloc_client()
aebe64667664 SUNRPC: prevent port reuse on transports which don't request it.
Comment 2 Daire Byrne 2022-02-02 22:57:21 UTC
Yea, I just applied:

87871d990a2c NFSv4: Initialise connection to the server in nfs4_alloc_client()

on top of v5.11 and that was enough to break noresvport for NFSv4.2.

Comment 3 Paul Menzel 2022-02-12 10:13:30 UTC
So that is commit dd99e9f98fbf (NFSv4: Initialise connection to the server in nfs4_alloc_client()), which went into v5.14-rc1.

Trond’s commit 468d126dab45 (NFS: Fix initialisation of nfs_client cl_flags field) has the problematic commit in its fixes tag [1]. It was just pulled by Linus, and is going to be in 5.17-rc4. Can you please test, if that fixes your issue?

[1]: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=468d126dab45718feeb728319be20bd869a5eaa7
Comment 4 Daire Byrne 2022-02-14 09:51:21 UTC
Apologies, I forgot to update this ticket last week.

Yes, I can confirm that Trond's recent patch does indeed fix this issue.


Comment 5 Paul Menzel 2022-02-14 10:09:57 UTC
Unfortunately, the issues is not referenced in the commit, but as the commit is referenced here now, I guess it can be closed as fixed.

Note You need to log in before you can comment on or make changes to this bug.