diff mbox

[1/1] nfs: Ensure NFS_MOUNT_TCP is correctly set for v4 mounts

Message ID 1401384351-21993-2-git-send-email-smayhew@redhat.com (mailing list archive)
State New, archived
Headers show

Commit Message

Scott Mayhew May 29, 2014, 5:25 p.m. UTC
The NFS_MOUNT_TCP flag needs to be correctly set in the nfs_server->flags
field, otherwise remount operations are likely to run afoul of the flags
check in nfs_compare_remount_data() on systems where /etc/mtab is
symlinked to /proc/mounts.

Signed-off-by: Scott Mayhew <smayhew@redhat.com>
---
 fs/nfs/super.c | 3 +++
 1 file changed, 3 insertions(+)

Comments

Trond Myklebust May 29, 2014, 5:33 p.m. UTC | #1
On Thu, May 29, 2014 at 1:25 PM, Scott Mayhew <smayhew@redhat.com> wrote:
> The NFS_MOUNT_TCP flag needs to be correctly set in the nfs_server->flags
> field, otherwise remount operations are likely to run afoul of the flags
> check in nfs_compare_remount_data() on systems where /etc/mtab is
> symlinked to /proc/mounts.
>
> Signed-off-by: Scott Mayhew <smayhew@redhat.com>
> ---
>  fs/nfs/super.c | 3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/fs/nfs/super.c b/fs/nfs/super.c
> index 2cb5694..0ae4e73 100644
> --- a/fs/nfs/super.c
> +++ b/fs/nfs/super.c
> @@ -2726,6 +2726,9 @@ static void nfs4_validate_mount_flags(struct nfs_parsed_mount_data *args)
>  {
>         args->flags &= ~(NFS_MOUNT_NONLM|NFS_MOUNT_NOACL|NFS_MOUNT_VER3|
>                          NFS_MOUNT_LOCAL_FLOCK|NFS_MOUNT_LOCAL_FCNTL);
> +
> +       if (args->nfs_server.protocol == XPRT_TRANSPORT_TCP)
> +               args->flags |= NFS_MOUNT_TCP;
>  }
>
>  /*
> --
> 1.9.0
>

Hi Scott,

Why can't we just apply the NFS_MOUNT_CMP_FLAGMASK to
nfs_compare_remount_data? NFS_MOUNT_TCP really is just legacy crud
from the bad old days of binary mount structures.

Cheers
  Trond
diff mbox

Patch

diff --git a/fs/nfs/super.c b/fs/nfs/super.c
index 2cb5694..0ae4e73 100644
--- a/fs/nfs/super.c
+++ b/fs/nfs/super.c
@@ -2726,6 +2726,9 @@  static void nfs4_validate_mount_flags(struct nfs_parsed_mount_data *args)
 {
 	args->flags &= ~(NFS_MOUNT_NONLM|NFS_MOUNT_NOACL|NFS_MOUNT_VER3|
 			 NFS_MOUNT_LOCAL_FLOCK|NFS_MOUNT_LOCAL_FCNTL);
+
+	if (args->nfs_server.protocol == XPRT_TRANSPORT_TCP)
+		args->flags |= NFS_MOUNT_TCP;
 }
 
 /*