linux-xfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] xfs: preserve inode versioning across remounts
@ 2020-07-14 22:11 Eric Sandeen
  2020-07-15  8:26 ` Dave Chinner
  2020-07-15 18:09 ` Christoph Hellwig
  0 siblings, 2 replies; 4+ messages in thread
From: Eric Sandeen @ 2020-07-14 22:11 UTC (permalink / raw)
  To: linux-xfs

The MS_I_VERSION mount flag is exposed via the VFS, as documented
in the mount manpages etc; see the iversion and noiversion mount
options in mount(8).

As a result, mount -o remount looks for this option in /proc/mounts
and will only send the I_VERSION flag back in during remount it it
is present.  Since it's not there, a remount will /remove/ the
I_VERSION flag at the vfs level, and iversion functionality is lost.

xfs v5 superblocks intend to always have i_version enabled; it is
set as a default at mount time, but is lost during remount for the
reasons above.

The generic fix would be to expose this documented option in 
/proc/mounts, but since that was rejected, fix it up again in the
xfs remount path instead, so that at least xfs won't suffer from
this misbehavior.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
--

diff --git a/fs/xfs/xfs_super.c b/fs/xfs/xfs_super.c
index 379cbff438bc..9239985571af 100644
--- a/fs/xfs/xfs_super.c
+++ b/fs/xfs/xfs_super.c
@@ -1714,6 +1714,10 @@ xfs_fc_reconfigure(
 	int			flags = fc->sb_flags;
 	int			error;
 
+	/* version 5 superblocks always support version counters. */
+	if (XFS_SB_VERSION_NUM(&mp->m_sb) == XFS_SB_VERSION_5)
+		fc->sb_flags |= SB_I_VERSION;
+
 	error = xfs_fc_validate_params(new_mp);
 	if (error)
 		return error;


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] xfs: preserve inode versioning across remounts
  2020-07-14 22:11 [PATCH] xfs: preserve inode versioning across remounts Eric Sandeen
@ 2020-07-15  8:26 ` Dave Chinner
  2020-07-15 18:09 ` Christoph Hellwig
  1 sibling, 0 replies; 4+ messages in thread
From: Dave Chinner @ 2020-07-15  8:26 UTC (permalink / raw)
  To: Eric Sandeen; +Cc: linux-xfs

On Tue, Jul 14, 2020 at 03:11:34PM -0700, Eric Sandeen wrote:
> The MS_I_VERSION mount flag is exposed via the VFS, as documented
> in the mount manpages etc; see the iversion and noiversion mount
> options in mount(8).
> 
> As a result, mount -o remount looks for this option in /proc/mounts
> and will only send the I_VERSION flag back in during remount it it
> is present.  Since it's not there, a remount will /remove/ the
> I_VERSION flag at the vfs level, and iversion functionality is lost.
> 
> xfs v5 superblocks intend to always have i_version enabled; it is
> set as a default at mount time, but is lost during remount for the
> reasons above.
> 
> The generic fix would be to expose this documented option in 
> /proc/mounts, but since that was rejected, fix it up again in the
> xfs remount path instead, so that at least xfs won't suffer from
> this misbehavior.
> 
> Signed-off-by: Eric Sandeen <sandeen@redhat.com>
> --
> 
> diff --git a/fs/xfs/xfs_super.c b/fs/xfs/xfs_super.c
> index 379cbff438bc..9239985571af 100644
> --- a/fs/xfs/xfs_super.c
> +++ b/fs/xfs/xfs_super.c
> @@ -1714,6 +1714,10 @@ xfs_fc_reconfigure(
>  	int			flags = fc->sb_flags;
>  	int			error;
>  
> +	/* version 5 superblocks always support version counters. */
> +	if (XFS_SB_VERSION_NUM(&mp->m_sb) == XFS_SB_VERSION_5)
> +		fc->sb_flags |= SB_I_VERSION;
> +
>  	error = xfs_fc_validate_params(new_mp);
>  	if (error)
>  		return error;

Looks fine.

Reviewed-by: Dave Chinner <dchinner@redhat.com>

-- 
Dave Chinner
david@fromorbit.com

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] xfs: preserve inode versioning across remounts
  2020-07-14 22:11 [PATCH] xfs: preserve inode versioning across remounts Eric Sandeen
  2020-07-15  8:26 ` Dave Chinner
@ 2020-07-15 18:09 ` Christoph Hellwig
  2020-07-15 19:04   ` Eric Sandeen
  1 sibling, 1 reply; 4+ messages in thread
From: Christoph Hellwig @ 2020-07-15 18:09 UTC (permalink / raw)
  To: Eric Sandeen; +Cc: linux-xfs

On Tue, Jul 14, 2020 at 03:11:34PM -0700, Eric Sandeen wrote:
> The MS_I_VERSION mount flag is exposed via the VFS, as documented
> in the mount manpages etc; see the iversion and noiversion mount
> options in mount(8).
> 
> As a result, mount -o remount looks for this option in /proc/mounts
> and will only send the I_VERSION flag back in during remount it it
> is present.  Since it's not there, a remount will /remove/ the
> I_VERSION flag at the vfs level, and iversion functionality is lost.
> 
> xfs v5 superblocks intend to always have i_version enabled; it is
> set as a default at mount time, but is lost during remount for the
> reasons above.

Looks good, this fixes the new mount API conversion, as the old code
automatically added it.  Maybe this wants a Fixes tag.

Reviewed-by: Christoph Hellwig <hch@lst.de>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] xfs: preserve inode versioning across remounts
  2020-07-15 18:09 ` Christoph Hellwig
@ 2020-07-15 19:04   ` Eric Sandeen
  0 siblings, 0 replies; 4+ messages in thread
From: Eric Sandeen @ 2020-07-15 19:04 UTC (permalink / raw)
  To: Christoph Hellwig, Eric Sandeen; +Cc: linux-xfs

On 7/15/20 11:09 AM, Christoph Hellwig wrote:
> On Tue, Jul 14, 2020 at 03:11:34PM -0700, Eric Sandeen wrote:
>> The MS_I_VERSION mount flag is exposed via the VFS, as documented
>> in the mount manpages etc; see the iversion and noiversion mount
>> options in mount(8).
>>
>> As a result, mount -o remount looks for this option in /proc/mounts
>> and will only send the I_VERSION flag back in during remount it it
>> is present.  Since it's not there, a remount will /remove/ the
>> I_VERSION flag at the vfs level, and iversion functionality is lost.
>>
>> xfs v5 superblocks intend to always have i_version enabled; it is
>> set as a default at mount time, but is lost during remount for the
>> reasons above.
> 
> Looks good, this fixes the new mount API conversion, as the old code
> automatically added it.  Maybe this wants a Fixes tag.
> 
> Reviewed-by: Christoph Hellwig <hch@lst.de>

AFAICT (and from testing) this behavior predates the mount API conversion.

Thanks,
-Eric

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-07-15 19:04 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-14 22:11 [PATCH] xfs: preserve inode versioning across remounts Eric Sandeen
2020-07-15  8:26 ` Dave Chinner
2020-07-15 18:09 ` Christoph Hellwig
2020-07-15 19:04   ` Eric Sandeen

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).