Skip to contentSkip to conversation

nfs-utils: Allow users to disable mount option rewriting via norewriteopts mount option

PATCH Gregory Boyce 2 participants 3 messages Apr 20, 2015 – Apr 24, 2015

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

Allow users to disable mount option rewriting via norewriteopts mount option.
This was required in our case in order to allow mounting a filer which inappropriately responded via the wrong interface.

---
 utils/mount/stropts.c | 8 ++++++++
 1 file changed, 8 insertions(+)
utils/mount/stropts.c +8 -0
index df67fac..bbda754 100644
@@ -534,6 +534,14 @@ nfs_rewrite_pmap_mount_options(struct mount_options *options, int checkv4)
 	struct pmap mnt_pmap;
 
 	/*
+	 * "norewriteopts" option bypasses the options rewriting
+	 */
+	if (po_contains(options, "norewriteopts") == PO_FOUND) {
+		po_remove_all(options, "norewriteopts");
+		return 1;
+	}
+
+	/*
 	 * Version and transport negotiation is not required
 	 * and does not work for RDMA mounts.
 	 */
Signature · 1 line
2.3.2 (Apple Git-55)
#1 lore raw

Hello,

Quoted 3 lines · Gregory Boyce

Allow users to disable mount option rewriting via norewriteopts mount option. This was required in our case in order to allow mounting a filer which inappropriately responded via the wrong interface.

Why are we adding a mount option to fix a broken server??

steved.

Quoted 25 lines
---
 utils/mount/stropts.c | 8 ++++++++
 1 file changed, 8 insertions(+)
utils/mount/stropts.c +8 -0
index df67fac..bbda754 100644
@@ -534,6 +534,14 @@ nfs_rewrite_pmap_mount_options(struct mount_options *options, int checkv4)
     struct pmap mnt_pmap;
 
     /*
+     * "norewriteopts" option bypasses the options rewriting
+     */
+    if (po_contains(options, "norewriteopts") == PO_FOUND) {
+        po_remove_all(options, "norewriteopts");
+        return 1;
+    }
+
+    /*
      * Version and transport negotiation is not required
      * and does not work for RDMA mounts.
      */
#2 lore raw
Quoted 12 lines · Steve Dickson

Hello,

Quoted 1 line · Gregory Boyce

Allow users to disable mount option rewriting via norewriteopts mount

option.

Quoted 2 lines

This was required in our case in order to allow mounting a filer which inappropriately responded via the wrong interface.

Why are we adding a mount option to fix a broken server??

steved.

Sometimes you only control the client, and it's useful to have the option to interoperate.

--
Greg