Merge tag 'nfs-for-5.13-1' of git://git.linux-nfs.org/projects/trondmy/linux-nfs
[linux-2.6-microblaze.git] / fs / nfs / super.c
index 5bfcc25..19a212f 100644 (file)
@@ -1041,7 +1041,7 @@ static void nfs_fill_super(struct super_block *sb, struct nfs_fs_context *ctx)
        sb->s_blocksize = 0;
        sb->s_xattr = server->nfs_client->cl_nfs_mod->xattr;
        sb->s_op = server->nfs_client->cl_nfs_mod->sops;
-       if (ctx && ctx->bsize)
+       if (ctx->bsize)
                sb->s_blocksize = nfs_block_size(ctx->bsize, &sb->s_blocksize_bits);
 
        if (server->nfs_client->rpc_ops->version != 2) {
@@ -1073,6 +1073,7 @@ static void nfs_fill_super(struct super_block *sb, struct nfs_fs_context *ctx)
                                                 &sb->s_blocksize_bits);
 
        nfs_super_set_maxbytes(sb, server->maxfilesize);
+       server->has_sec_mnt_opts = ctx->has_sec_mnt_opts;
 }
 
 static int nfs_compare_mount_options(const struct super_block *s, const struct nfs_server *b,
@@ -1189,6 +1190,9 @@ static int nfs_compare_super(struct super_block *sb, struct fs_context *fc)
                return 0;
        if (!nfs_compare_userns(old, server))
                return 0;
+       if ((old->has_sec_mnt_opts || fc->security) &&
+                       security_sb_mnt_opts_compat(sb, fc->security))
+               return 0;
        return nfs_compare_mount_options(sb, server, fc);
 }