Re: Inverted mount options completely broken (iversion,relatime)

From: David Howells
Date: Wed Jul 29 2020 - 16:37:09 EST


Josef Bacik <josef@xxxxxxxxxxxxxx> 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)));

David