Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

nfs: Apply NFS_MOUNT_CMP_FLAGMASK to nfs_compare_remount_data()

Those flags are obsolete and checking them can incorrectly cause
remount operations to fail.

Signed-off-by: Scott Mayhew <smayhew@redhat.com>
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>

authored by

Scott Mayhew and committed by
Trond Myklebust
c8e47028 8935ef66

+13 -13
+13 -13
fs/nfs/super.c
··· 2180 2180 return -EINVAL; 2181 2181 } 2182 2182 2183 + #define NFS_MOUNT_CMP_FLAGMASK ~(NFS_MOUNT_INTR \ 2184 + | NFS_MOUNT_SECURE \ 2185 + | NFS_MOUNT_TCP \ 2186 + | NFS_MOUNT_VER3 \ 2187 + | NFS_MOUNT_KERBEROS \ 2188 + | NFS_MOUNT_NONLM \ 2189 + | NFS_MOUNT_BROKEN_SUID \ 2190 + | NFS_MOUNT_STRICTLOCK \ 2191 + | NFS_MOUNT_UNSHARED \ 2192 + | NFS_MOUNT_NORESVPORT \ 2193 + | NFS_MOUNT_LEGACY_INTERFACE) 2194 + 2183 2195 static int 2184 2196 nfs_compare_remount_data(struct nfs_server *nfss, 2185 2197 struct nfs_parsed_mount_data *data) 2186 2198 { 2187 - if (data->flags != nfss->flags || 2199 + if ((data->flags ^ nfss->flags) & NFS_MOUNT_CMP_FLAGMASK || 2188 2200 data->rsize != nfss->rsize || 2189 2201 data->wsize != nfss->wsize || 2190 2202 data->version != nfss->nfs_client->rpc_ops->version || ··· 2358 2346 2359 2347 nfs_initialise_sb(sb); 2360 2348 } 2361 - 2362 - #define NFS_MOUNT_CMP_FLAGMASK ~(NFS_MOUNT_INTR \ 2363 - | NFS_MOUNT_SECURE \ 2364 - | NFS_MOUNT_TCP \ 2365 - | NFS_MOUNT_VER3 \ 2366 - | NFS_MOUNT_KERBEROS \ 2367 - | NFS_MOUNT_NONLM \ 2368 - | NFS_MOUNT_BROKEN_SUID \ 2369 - | NFS_MOUNT_STRICTLOCK \ 2370 - | NFS_MOUNT_UNSHARED \ 2371 - | NFS_MOUNT_NORESVPORT \ 2372 - | NFS_MOUNT_LEGACY_INTERFACE) 2373 2349 2374 2350 static int nfs_compare_mount_options(const struct super_block *s, const struct nfs_server *b, int flags) 2375 2351 {