David Howells <dhowells@xxxxxxxxxx> wrote: > > So my question is, what do we do here? > > Hmmm... As the code stands, MS_RDONLY, MS_SYNCHRONOUS, MS_MANDLOCK, > MS_I_VERSION and MS_LAZYTIME should all be masked off before the new flags are > set if called from mount(2) rather than fsconfig(2). > > do_remount() gives MS_RMT_MASK to fs_context_for_reconfigure() to load into > fc->sb_flags_mask, which should achieve the desired effect in > reconfigure_super() on this line: > > WRITE_ONCE(sb->s_flags, ((sb->s_flags & ~fc->sb_flags_mask) | > (fc->sb_flags & fc->sb_flags_mask))); So applying the attached patch and then doing: mount -t tmpfs none /mnt mount -o remount,iversion /mnt mount -o remount,noiversion /mnt mount -o remount,norelatime /mnt mount -o remount,relatime /mnt prints: sb=70010000 set=800000 mask=2800051 sb=70810000 set=0 mask=2800051 sb=70010000 set=0 mask=2800051 sb=70010000 set=0 mask=2800051 MS_RELATIME isn't included in MS_RMT_MASK, so remount shouldn't be able to change it. David --- diff --git a/fs/super.c b/fs/super.c index 904459b35119..540cb37c11e7 100644 --- a/fs/super.c +++ b/fs/super.c @@ -964,6 +964,7 @@ int reconfigure_super(struct fs_context *fc) } } + printk("sb=%lx set=%x mask=%x\n", sb->s_flags, fc->sb_flags, fc->sb_flags_mask); WRITE_ONCE(sb->s_flags, ((sb->s_flags & ~fc->sb_flags_mask) | (fc->sb_flags & fc->sb_flags_mask))); /* Needs to be ordered wrt mnt_is_readonly() */