diff mbox

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

Message ID alpine.DEB.2.10.1504201417410.5338@valhalla.home (mailing list archive)
State New, archived
Headers show

Commit Message

Gregory Boyce April 20, 2015, 6:18 p.m. UTC
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.

Signed-off-by: Gregory Boyce <gregory.boyce@gmail.com>
---
  utils/mount/stropts.c | 8 ++++++++
  1 file changed, 8 insertions(+)

Comments

Steve Dickson May 6, 2015, 8:14 p.m. UTC | #1
On 04/20/2015 02:18 PM, Gregory Boyce wrote:
> 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.
> 
> Signed-off-by: Gregory Boyce <gregory.boyce@gmail.com>
Again... This is fixing a filer bug, correct? 

We generally don't do that... 

steved.

> ---
>  utils/mount/stropts.c | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/utils/mount/stropts.c b/utils/mount/stropts.c
> index df67fac..bbda754 100644
> --- a/utils/mount/stropts.c
> +++ b/utils/mount/stropts.c
> @@ -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.
>       */
--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Gregory Boyce May 6, 2015, 8:28 p.m. UTC | #2
On Wed, May 6, 2015 at 4:14 PM, Steve Dickson <SteveD@redhat.com> wrote:
>
>
> On 04/20/2015 02:18 PM, Gregory Boyce wrote:
>> 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.
>>
>> Signed-off-by: Gregory Boyce <gregory.boyce@gmail.com>
> Again... This is fixing a filer bug, correct?
>
> We generally don't do that...
>
> steved.

This is working around a server bug on the client side, yes.
Steve Dickson May 7, 2015, 1:48 p.m. UTC | #3
On 05/06/2015 04:28 PM, Gregory Boyce wrote:
> On Wed, May 6, 2015 at 4:14 PM, Steve Dickson <SteveD@redhat.com> wrote:
>>
>>
>> On 04/20/2015 02:18 PM, Gregory Boyce wrote:
>>> 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.
>>>
>>> Signed-off-by: Gregory Boyce <gregory.boyce@gmail.com>
>> Again... This is fixing a filer bug, correct?
>>
>> We generally don't do that...
>>
>> steved.
> 
> This is working around a server bug on the client side, yes.
> 
That's tough... We generally don't do that because its becomes
a very slippy slope very quickly.... esp with adding a undocumented
mount flag we are going have to support forever...

This is something I just don't think is the right thing to do
so I'm going to NAK this patch. 

steved.


 
--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/utils/mount/stropts.c b/utils/mount/stropts.c
index df67fac..bbda754 100644
--- a/utils/mount/stropts.c
+++ b/utils/mount/stropts.c
@@ -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.
  	 */