linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dave Wysochanski <dwysocha@redhat.com>
To: Scott Mayhew <smayhew@redhat.com>
Cc: trond.myklebust@primarydata.com, linux-nfs@vger.kernel.org
Subject: Re: [PATCH] nfs: reject changes to resvport and sharecache during remount
Date: Tue, 05 Aug 2014 09:52:01 -0400	[thread overview]
Message-ID: <1407246721.4455.32.camel@dwysocha-rhel7-t530.usersys.redhat.com> (raw)
In-Reply-To: <1407188247-3050-1-git-send-email-smayhew@redhat.com>

On Mon, 2014-08-04 at 17:37 -0400, Scott Mayhew wrote:
> Commit c8e47028 made it possible to change resvport/noresvport and
> sharecache/nosharecache via a remount operation, neither of which should be
> allowed.
> 
> Signed-off-by: Scott Mayhew <smayhew@redhat.com>
> ---
>  fs/nfs/super.c | 9 +++++----
>  1 file changed, 5 insertions(+), 4 deletions(-)
> 
> diff --git a/fs/nfs/super.c b/fs/nfs/super.c
> index 084af10..3fd8332 100644
> --- a/fs/nfs/super.c
> +++ b/fs/nfs/super.c
> @@ -2180,7 +2180,7 @@ out_no_address:
>  	return -EINVAL;
>  }
>  
> -#define NFS_MOUNT_CMP_FLAGMASK ~(NFS_MOUNT_INTR \
> +#define NFS_REMOUNT_CMP_FLAGMASK ~(NFS_MOUNT_INTR \
>  		| NFS_MOUNT_SECURE \
>  		| NFS_MOUNT_TCP \
>  		| NFS_MOUNT_VER3 \
> @@ -2188,15 +2188,16 @@ out_no_address:
>  		| NFS_MOUNT_NONLM \
>  		| NFS_MOUNT_BROKEN_SUID \
>  		| NFS_MOUNT_STRICTLOCK \
> -		| NFS_MOUNT_UNSHARED \
> -		| NFS_MOUNT_NORESVPORT \
>  		| NFS_MOUNT_LEGACY_INTERFACE)
>  
> +#define NFS_MOUNT_CMP_FLAGMASK (NFS_REMOUNT_CMP_FLAGMASK & \
> +		~(NFS_MOUNT_UNSHARED | NFS_MOUNT_NORESVPORT))
> +
>  static int
>  nfs_compare_remount_data(struct nfs_server *nfss,
>  			 struct nfs_parsed_mount_data *data)
>  {
> -	if ((data->flags ^ nfss->flags) & NFS_MOUNT_CMP_FLAGMASK ||
> +	if ((data->flags ^ nfss->flags) & NFS_REMOUNT_CMP_FLAGMASK ||
>  	    data->rsize != nfss->rsize ||
>  	    data->wsize != nfss->wsize ||
>  	    data->version != nfss->nfs_client->rpc_ops->version ||

I reviewed this and it looks good to me.

Reviewed-by: Dave Wysochanski <dwysocha@redhat.com>




      reply	other threads:[~2014-08-05 13:52 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-04 21:37 [PATCH] nfs: reject changes to resvport and sharecache during remount Scott Mayhew
2014-08-05 13:52 ` Dave Wysochanski [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1407246721.4455.32.camel@dwysocha-rhel7-t530.usersys.redhat.com \
    --to=dwysocha@redhat.com \
    --cc=linux-nfs@vger.kernel.org \
    --cc=smayhew@redhat.com \
    --cc=trond.myklebust@primarydata.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).