Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1662055 > unrolled thread

Some filesystems set MNT_* flags in superblock->s_flags

Started byDavid Howells <dhowells@redhat.com>
First post2017-06-09 09:50 +0200
Last post2017-06-09 10:10 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Some filesystems set MNT_* flags in superblock->s_flags David Howells <dhowells@redhat.com> - 2017-06-09 09:50 +0200
    Re: Some filesystems set MNT_* flags in superblock->s_flags Miklos Szeredi <mszeredi@redhat.com> - 2017-06-09 10:10 +0200

#1662055 — Some filesystems set MNT_* flags in superblock->s_flags

FromDavid Howells <dhowells@redhat.com>
Date2017-06-09 09:50 +0200
SubjectSome filesystems set MNT_* flags in superblock->s_flags
Message-ID<tQmQb-78W-49@gated-at.bofh.it>
Al Viro <viro@ZenIV.linux.org.uk> wrote:

> 	* what the hell is ms_flags thing doing in __vfs_new_sb_config()?
> It's a really vile mix of unrelated flags and operations we had in existing
> mount(2) ABI.  With MS_KERNMOUNT thrown into that loo^Wmix.  Sure, we need
> to parse the garbage fed to mount(2).  And we need to pass that garbage to
> "legacy" types as well, but let's not inflict it upon the new mechanisms.

Hmmm...  Some ->remount_fs() operations attempt to alter the MS_* flags that
correspond to MNT_* flags.  Coda, for example:

	static int coda_remount(struct super_block *sb, int *flags, char *data)
	{
		sync_filesystem(sb);
		*flags |= MS_NOATIME;
		return 0;
	}

But this is quashed in do_remount_sb:

	sb->s_flags = (sb->s_flags & ~MS_RMT_MASK) | (flags & MS_RMT_MASK);

And others set them directly in s_flags, v9fs_fill_super() for example sets
MS_NOATIME:

	sb->s_flags |= MS_ACTIVE | MS_DIRSYNC | MS_NOATIME;

I'm guessing things like this should be got rid of, but does there need to be
a way to inform mount() that these should be set on the vfsmount?

David

[toc] | [next] | [standalone]


#1662070

FromMiklos Szeredi <mszeredi@redhat.com>
Date2017-06-09 10:10 +0200
Message-ID<tQn9v-7uN-13@gated-at.bofh.it>
In reply to#1662055
On Fri, Jun 9, 2017 at 9:48 AM, David Howells <dhowells@redhat.com> wrote:
> Al Viro <viro@ZenIV.linux.org.uk> wrote:
>
>>       * what the hell is ms_flags thing doing in __vfs_new_sb_config()?
>> It's a really vile mix of unrelated flags and operations we had in existing
>> mount(2) ABI.  With MS_KERNMOUNT thrown into that loo^Wmix.  Sure, we need
>> to parse the garbage fed to mount(2).  And we need to pass that garbage to
>> "legacy" types as well, but let's not inflict it upon the new mechanisms.
>
> Hmmm...  Some ->remount_fs() operations attempt to alter the MS_* flags that
> correspond to MNT_* flags.  Coda, for example:
>
>         static int coda_remount(struct super_block *sb, int *flags, char *data)
>         {
>                 sync_filesystem(sb);
>                 *flags |= MS_NOATIME;
>                 return 0;
>         }
>
> But this is quashed in do_remount_sb:
>
>         sb->s_flags = (sb->s_flags & ~MS_RMT_MASK) | (flags & MS_RMT_MASK);
>
> And others set them directly in s_flags, v9fs_fill_super() for example sets
> MS_NOATIME:
>
>         sb->s_flags |= MS_ACTIVE | MS_DIRSYNC | MS_NOATIME;
>
> I'm guessing things like this should be got rid of, but does there need to be
> a way to inform mount() that these should be set on the vfsmount?

Looks like MS_NOATIME is used in two *completely* separate roles:

  - passed to mount(2) to set MNT_NOATIME
  - set on sb->s_flags by filesystem to prevent atime modification

Btw. the second role can also be achieved by setting S_NOATIME on
inode, so this role of MS_NOATIME looks like being superfluous.

Thanks,
Miklos

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web