Skip to contentSkip to conversation

mount.nfs kernel version check override

NFS Jon Mason 2 participants 2 messages Mar 2, 2009 – Mar 3, 2009

Subsystems (2)
lore
Share & tools
lore

Jon Mason

author
#0 lore raw

I am working on backporting NFS-RDMA to older versions of Linux for the Open Fabrics Linux kernel stack (OFED). I have backported NFS-RDMA to RHEL5.2 (which has a kernel based on 2.6.18), and others are working on backporting to other older kernels. The issue that I have and they will discover is that there is a check in the mount command for kernels greater than 2.6.22. If it is older than this version, it will not pass args to the kernel.

I have come up with a patch to add an additional flag to the mount command to allow this kernel version check to be over-ruled. Please consider adding it to the next release of the nfs-utils.

Thanks,
Jon

mount/mount.c renamed from mount/mount.c.orig +5 -1
@@ -331,6 +331,7 @@ void mount_usage(void)
 	printf(_("\t-f\t\tFake mount, do not actually mount\n"));
 	printf(_("\t-n\t\tDo not update /etc/mtab\n"));
 	printf(_("\t-s\t\tTolerate sloppy mount options rather than fail\n"));
+	printf(_("\t-i\t\tIgnore kernel version limitations\n"));
 	printf(_("\t-h\t\tPrint this help\n"));
 	printf(_("\tnfsoptions\tRefer to mount.nfs(8) or nfs(5)\n\n"));
 }
@@ -475,7 +476,7 @@ int main(int argc, char *argv[])
 	mount_point = argv[2];
 
 	argv[2] = argv[0]; /* so that getopt error messages are correct */
-	while ((c = getopt_long(argc - 2, argv + 2, "rvVwfno:hs",
+	while ((c = getopt_long(argc - 2, argv + 2, "rvVwfno:hsi",
 				longopts, NULL)) != -1) {
 		switch (c) {
 		case 'r':
@@ -505,6 +506,9 @@ int main(int argc, char *argv[])
 		case 's':
 			++sloppy;
 			break;
+		case 'i':
+			string++;
+			break;
 		case 'h':
 		default:
 			mount_usage();

------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA -OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise -Strategies to boost innovation and cut costs with open source participation -Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H

_______________________________________________
NFS maillist - [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs
_______________________________________________
Please note that [email protected] is being discontinued. Please subscribe to [email protected] instead.
http://vger.kernel.org/vger-lists.html#linux-nfs

#1 lore raw
Cc corrected.
Quoted 7 lines · Jon Mason

I am working on backporting NFS-RDMA to older versions of Linux for the Open Fabrics Linux kernel stack (OFED). I have backported NFS-RDMA to RHEL5.2 (which has a kernel based on 2.6.18), and others are working on backporting to other older kernels. The issue that I have and they will discover is that there is a check in the mount command for kernels greater than 2.6.22. If it is older than this version, it will not pass args to the kernel.

That's because those older kernels don't support text-based mount options. That will always be true of those upstream kernels.

Quoted 3 lines

I have come up with a patch to add an additional flag to the mount command to allow this kernel version check to be over-ruled. Please consider adding it to the next release of the nfs-utils.

I am not the maintainer of nfs-utils, however: In general, features for backports like this are not considered for upstream. They are usually your responsibility. In this case, you would maintain your own copy of the mount command (or nfs-utils) that alters the kernel version check as needed.

Also, there used to be a "-i" switch that forced the mount.nfs command to send text-based mount options to the kernel. The reason it was never taken upstream was because no-one issues the mount.nfs command directly: it's a subcommand that is executed by the mount command. So there's no way to use it in /etc/fstab, for example. Not very useful!

Finally, the usual practice is to place a proposed patch in the body of an e-mail rather than using an attachment when posting patches. Most people find that easier to manage with patch tools, and can use normal reply quoting when reviewing and commenting on the patch.

Thanks!

--
Chuck Lever
chuck[dot]lever[at]oracle[dot]com