linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Eric Sandeen <sandeen@sandeen.net>
To: "Darrick J. Wong" <darrick.wong@oracle.com>
Cc: "J. Bruce Fields" <bfields@fieldses.org>,
	Christoph Hellwig <hch@infradead.org>,
	Masayoshi Mizuma <msys.mizuma@gmail.com>,
	Theodore Ts'o <tytso@mit.edu>,
	Andreas Dilger <adilger.kernel@dilger.ca>,
	Alexander Viro <viro@zeniv.linux.org.uk>,
	Masayoshi Mizuma <m.mizuma@jp.fujitsu.com>,
	linux-ext4@vger.kernel.org, linux-fsdevel@vger.kernel.org,
	linux-xfs <linux-xfs@vger.kernel.org>
Subject: Re: [PATCH] fs: i_version mntopt gets visible through /proc/mounts
Date: Wed, 17 Jun 2020 12:55:24 -0500	[thread overview]
Message-ID: <8f0df756-4f71-9d96-7a52-45bf51482556@sandeen.net> (raw)
In-Reply-To: <20200617172456.GP11245@magnolia>

On 6/17/20 12:24 PM, Darrick J. Wong wrote:
> On Wed, Jun 17, 2020 at 12:14:28PM -0500, Eric Sandeen wrote:
>>
>>
>> On 6/17/20 10:58 AM, J. Bruce Fields wrote:
>>> On Wed, Jun 17, 2020 at 01:03:14AM -0700, Christoph Hellwig wrote:
>>>> On Tue, Jun 16, 2020 at 04:21:23PM -0400, Masayoshi Mizuma wrote:
>>>>> From: Masayoshi Mizuma <m.mizuma@jp.fujitsu.com>
>>>>>
>>>>> /proc/mounts doesn't show 'i_version' even if iversion
>>>>> mount option is set to XFS.
>>>>>
>>>>> iversion mount option is a VFS option, not ext4 specific option.
>>>>> Move the handler to show_sb_opts() so that /proc/mounts can show
>>>>> 'i_version' on not only ext4 but also the other filesystem.
>>>>
>>>> SB_I_VERSION is a kernel internal flag.  XFS doesn't have an i_version
>>>> mount option.
>>>
>>> It probably *should* be a kernel internal flag, but it seems to work as
>>> a mount option too.
>>
>> Not on XFS AFAICT:
>>
>> [600280.685810] xfs: Unknown parameter 'i_version'
> 
> Yeah, because the mount option is 'iversion', not 'i_version'.  Even if

unless you're ext4:

{Opt_i_version, "i_version"},

ok "iversion" is what mount(8) takes and translates into MS_I_VERSION (thanks Darrick)

# strace -vv -emount mount -oloop,iversion fsfile mnt
mount("/dev/loop0", "/tmp/mnt", "xfs", MS_I_VERSION, NULL) = 0

FWIW, mount actually seems to pass what it finds in /proc/mounts back in on remount for ext4:

# strace -vv -emount mount -o remount mnt
mount("/dev/loop0", "/tmp/mnt", 0x55bfcbdca150, MS_REMOUNT|MS_RELATIME, "seclabel,i_version,data=ordered") = 0

but it still looks unhandled on remount.  Perhaps if /proc/mounts exposed
"iversion" (not "i_version") then mount -o remount would DTRT.

-Eric

> you were going to expose the flag state in /proc/mounts, the text string
> should match the mount option.
> 
>> so we can't be exporting "mount options" for xfs that aren't actually
>> going to be accepted by the filesystem.
>>
>>> By coincidence I've just been looking at a bug report showing that
>>> i_version support is getting accidentally turned off on XFS whenever
>>> userspace does a read-write remount.
>>>
>>> Is there someplace in the xfs mount code where it should be throwing out
>>> SB_I_VERSION?
>>
>> <cc xfs list>
>>
>> XFS doesn't manipulate that flag on remount.  We just turn it on by default
>> for modern filesystem formats:
>>
>>         /* version 5 superblocks support inode version counters. */
>>         if (XFS_SB_VERSION_NUM(&mp->m_sb) == XFS_SB_VERSION_5)
>>                 sb->s_flags |= SB_I_VERSION;
>>
>> Also, this behavior doesn't seem unique to xfs:
>>
>> # mount -o loop,i_version fsfile test_iversion
>> # grep test_iversion /proc/mounts
>> /dev/loop4 /tmp/test_iversion ext4 rw,seclabel,relatime,i_version 0 0
>> # mount -o remount test_iversion
>> # grep test_iversion /proc/mounts
>> /dev/loop4 /tmp/test_iversion ext4 rw,seclabel,relatime 0 0
>> # uname -a
>> Linux <hostname> 5.7.0-rc4+ #7 SMP Wed Jun 10 14:01:34 EDT 2020 x86_64 x86_64 x86_64 GNU/Linux
> 
> Probably because do_mount clears it and I guess xfs don't re-enable
> it in any of their remount functions...



  reply	other threads:[~2020-06-17 17:55 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-16 20:21 [PATCH] fs: i_version mntopt gets visible through /proc/mounts Masayoshi Mizuma
2020-06-17  8:03 ` Christoph Hellwig
2020-06-17 13:33   ` Masayoshi Mizuma
2020-06-17 15:58   ` J. Bruce Fields
2020-06-17 17:14     ` Eric Sandeen
2020-06-17 17:24       ` Darrick J. Wong
2020-06-17 17:55         ` Eric Sandeen [this message]
2020-06-17 18:18           ` J. Bruce Fields
2020-06-17 18:28             ` Eric Sandeen
2020-06-17 18:45               ` J. Bruce Fields
2020-06-18  1:30                 ` Masayoshi Mizuma
2020-06-18  1:44                   ` Darrick J. Wong
2020-06-18  3:33                     ` Masayoshi Mizuma
2020-06-18  3:05                   ` Dave Chinner
2020-06-18  3:45                     ` Masayoshi Mizuma
2020-06-18 22:39                       ` Dave Chinner
2020-06-19  2:20                         ` J. Bruce Fields
2020-06-19  2:44                           ` Dave Chinner
2020-06-19 12:04                             ` Jeff Layton
2020-06-19 20:40                             ` J. Bruce Fields
2020-06-19 22:10                               ` Dave Chinner
2020-06-19 22:28                                 ` J. Bruce Fields
2020-06-20  1:49                                   ` Dave Chinner
2020-06-20  1:56                                     ` J. Bruce Fields
2020-06-20 17:00                                       ` Eric Sandeen
2020-06-20 17:09                                         ` J. Bruce Fields
2020-06-20 23:54                                       ` Dave Chinner
2020-06-22 21:26                                         ` J. Bruce Fields
2020-06-22 22:03                                           ` Dave Chinner
2020-06-19 13:17                         ` Christoph Hellwig
2020-07-13 23:45                         ` Eric Sandeen
2020-07-14  8:30                           ` Christoph Hellwig
2020-07-14 20:26                             ` Eric Sandeen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8f0df756-4f71-9d96-7a52-45bf51482556@sandeen.net \
    --to=sandeen@sandeen.net \
    --cc=adilger.kernel@dilger.ca \
    --cc=bfields@fieldses.org \
    --cc=darrick.wong@oracle.com \
    --cc=hch@infradead.org \
    --cc=linux-ext4@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-xfs@vger.kernel.org \
    --cc=m.mizuma@jp.fujitsu.com \
    --cc=msys.mizuma@gmail.com \
    --cc=tytso@mit.edu \
    --cc=viro@zeniv.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).