Skip to content

Commit 26c4c17

Browse files
jtlaytonTrond Myklebust
authored andcommitted
nfs: don't lose MS_SYNCHRONOUS on remount of noac mount
On a remount, the VFS layer will clear the MS_SYNCHRONOUS bit on the assumption that the flags on the mount syscall will have it set if the remounted fs is supposed to keep it. In the case of "noac" though, MS_SYNCHRONOUS is implied. A remount of such a mount will lose the MS_SYNCHRONOUS flag since "sync" isn't part of the mount options. Reported-by: Max Matveev <[email protected]> Signed-off-by: Jeff Layton <[email protected]> Cc: [email protected] Signed-off-by: Trond Myklebust <[email protected]>
1 parent 613e901 commit 26c4c17

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

fs/nfs/super.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1977,6 +1977,15 @@ nfs_remount(struct super_block *sb, int *flags, char *raw_data)
19771977
if (error < 0)
19781978
goto out;
19791979

1980+
/*
1981+
* noac is a special case. It implies -o sync, but that's not
1982+
* necessarily reflected in the mtab options. do_remount_sb
1983+
* will clear MS_SYNCHRONOUS if -o sync wasn't specified in the
1984+
* remount options, so we have to explicitly reset it.
1985+
*/
1986+
if (data->flags & NFS_MOUNT_NOAC)
1987+
*flags |= MS_SYNCHRONOUS;
1988+
19801989
/* compare new mount options with old ones */
19811990
error = nfs_compare_remount_data(nfss, data);
19821991
out:

0 commit comments

Comments
 (0)