Skip to content

Commit 0aea92b

Browse files
Trond MyklebustTrond Myklebust
authored andcommitted
NFS: nfs_compare_super shouldn't check the auth flavour unless 'sec=' was set
Also don't worry about obsolete mount flags... Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
1 parent 47040da commit 0aea92b

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

fs/nfs/super.c

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2295,6 +2295,18 @@ void nfs_clone_super(struct super_block *sb, struct nfs_mount_info *mount_info)
22952295
nfs_initialise_sb(sb);
22962296
}
22972297

2298+
#define NFS_MOUNT_CMP_FLAGMASK ~(NFS_MOUNT_INTR \
2299+
| NFS_MOUNT_SECURE \
2300+
| NFS_MOUNT_TCP \
2301+
| NFS_MOUNT_VER3 \
2302+
| NFS_MOUNT_KERBEROS \
2303+
| NFS_MOUNT_NONLM \
2304+
| NFS_MOUNT_BROKEN_SUID \
2305+
| NFS_MOUNT_STRICTLOCK \
2306+
| NFS_MOUNT_UNSHARED \
2307+
| NFS_MOUNT_NORESVPORT \
2308+
| NFS_MOUNT_LEGACY_INTERFACE)
2309+
22982310
static int nfs_compare_mount_options(const struct super_block *s, const struct nfs_server *b, int flags)
22992311
{
23002312
const struct nfs_server *a = s->s_fs_info;
@@ -2305,7 +2317,7 @@ static int nfs_compare_mount_options(const struct super_block *s, const struct n
23052317
goto Ebusy;
23062318
if (a->nfs_client != b->nfs_client)
23072319
goto Ebusy;
2308-
if (a->flags != b->flags)
2320+
if ((a->flags ^ b->flags) & NFS_MOUNT_CMP_FLAGMASK)
23092321
goto Ebusy;
23102322
if (a->wsize != b->wsize)
23112323
goto Ebusy;
@@ -2319,7 +2331,8 @@ static int nfs_compare_mount_options(const struct super_block *s, const struct n
23192331
goto Ebusy;
23202332
if (a->acdirmax != b->acdirmax)
23212333
goto Ebusy;
2322-
if (clnt_a->cl_auth->au_flavor != clnt_b->cl_auth->au_flavor)
2334+
if (b->flags & NFS_MOUNT_SECFLAVOUR &&
2335+
clnt_a->cl_auth->au_flavor != clnt_b->cl_auth->au_flavor)
23232336
goto Ebusy;
23242337
return 1;
23252338
Ebusy:

0 commit comments

Comments
 (0)