Bug 218138 - NFSv4 referrals - no way to define custom (non-2049) port numbers for referrals
Summary: NFSv4 referrals - no way to define custom (non-2049) port numbers for referrals
Status: ASSIGNED
Alias: None
Product: File System
Classification: Unclassified
Component: NFS (show other bugs)
Hardware: All Linux
: P3 enhancement
Assignee: Chuck Lever
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-11-13 00:00 UTC by Cedric Blancher
Modified: 2024-01-16 14:26 UTC (History)
1 user (show)

See Also:
Kernel Version:
Subsystem:
Regression: No
Bisected commit-id:


Attachments

Description Cedric Blancher 2023-11-13 00:00:00 UTC
NFSv4 referrals - currently there is no way to define custom (non-2049) port numbers for referrals, e.g. this should work, but right now it does not:

To redirect an NFS mount from local machine /ref/baguette to
/export/home/baguette on host 134.49.22.111 port 6666 add this to Linux
/etc/exports:
--cut--cut--cut--cut--
/ref *(no_root_squash,refer=/export/home@134.49.22.111:6666)
--cut--cut--cut--cut--
Comment 1 Chuck Lever 2023-11-13 14:13:29 UTC
There are no documented claims that NFSD has ever supported referrals to alternate ports. Thus technically this is not a regression or bug, but rather an unimplemented feature. We agree that NFSv4 referrals to alternate ports is a desirable and appropriate capability for NFSD.

However, there are some limitations in the kernel's mountd upcall API that have prevented the easy implementation of this capability, and it's never been a priority to finish it.

Because this is essentially a feature request, I would prefer it to be filed on bugzilla.linux-nfs.org where all other NFSD feature requests reside. Please file a bug there (product "kernel" component "server"), and add a link to that bug as a comment here.

Also note that changes to mountd, which is a user space utility, will be needed to add this capability.
Comment 2 Cedric Blancher 2023-11-17 07:41:12 UTC
I cannot access bugzilla.linux-nfs.org, it it does not send a "account verification token email" to me.
Comment 3 Cedric Blancher 2023-11-19 17:21:12 UTC
bugzilla.linux-nfs.org is GONE, REOPENening
Comment 4 Chuck Lever 2023-11-21 15:45:08 UTC
(In reply to Cedric Blancher from comment #3)
> bugzilla.linux-nfs.org is GONE, REOPENening

Probably not, but while it's in limbo: I would still much prefer this issue to be filed with the rest of our NFSD enhancement requests on bugzilla.linux-nfs.org. But until we can get you an account on that bugzilla, we can discuss your ER here.

There is support for storing an alternate port in a junction:

$ sudo nfsref lookup /export/ext4/junction/
home.example.net:/

	NFS port:	2049
	Valid for:	0
	Currency:	-1
	Flags:		varsub(false)
	GenFlags:	writable(false), going(false), split(true)
	TransFlags:	rdma(true)
	Class:		simul(0), handle(0), fileid(0)
	Class:		writever(0), change(0), readdir(0)
	Read:		rank(0), order(0)
	Write:		rank(0), order(0)

$

What is missing is the ability for this port information to be communicated from mountd (which reads the junction) to the kernel. The mountd downcall arguments are gravely limited.

Today the Linux kernel supports GETATTR(fs_locations) but not GETATTR(fs_location_info).

The former can communicate only a server network identity and an export path for each referral target.

The latter, which was added in the NFSv4.1 protocol, has a much richer set of information for each referral target. You can see that information in the junction lookup output above; junctions can store all of that information today, even though it isn't yet used.

The current mountd downcall protocol is limited, making it difficult to add support for this extra information. Including this information as part of a refer= or replica= export option would also be quite cumbersome, if not impossible. That is why these options are deprecated in favor of using nfsref.

Our plan of record is to replace the mountd downcall with a new netlink protocol. Netlink protocols are nicely extensible and would be able to handle all of this information properly, including an alternate port for each referral target.

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