Skip to content

Commit

Permalink
NFSv4: Fix the sync mount option for nfs4 mounts
Browse files Browse the repository at this point in the history
The sync mount option stopped working for NFSv4 mounts after commit
c02d7ad (NFSv4: Replace nfs4_path_walk() with
FS path lookup in a private namespace).  If MS_SYNCHRONOUS is set in the
super_block that we're cloning from, then it should be set in the new
super_block as well.

Signed-off-by: Scott Mayhew <smayhew@redhat.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
  • Loading branch information
scottmayhew authored and Trond Myklebust committed Aug 7, 2013
1 parent f8806c8 commit e890db0
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions fs/nfs/super.c
Original file line number Diff line number Diff line change
Expand Up @@ -2478,6 +2478,10 @@ struct dentry *nfs_fs_mount_common(struct nfs_server *server,
if (server->flags & NFS_MOUNT_NOAC)
sb_mntdata.mntflags |= MS_SYNCHRONOUS;

if (mount_info->cloned != NULL && mount_info->cloned->sb != NULL)
if (mount_info->cloned->sb->s_flags & MS_SYNCHRONOUS)
sb_mntdata.mntflags |= MS_SYNCHRONOUS;

/* Get a superblock - note that we may end up sharing one that already exists */
s = sget(nfs_mod->nfs_fs, compare_super, nfs_set_super, flags, &sb_mntdata);
if (IS_ERR(s)) {
Expand Down

0 comments on commit e890db0

Please sign in to comment.