Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp992523ybt; Wed, 17 Jun 2020 20:13:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJybko+KL2FDEyoF+brMQZGt42CKNs2UjKnNfVFbjeIEnTGeMfdyH94avF1r43jvYXNGNsIY X-Received: by 2002:a17:906:f2d9:: with SMTP id gz25mr2147252ejb.467.1592449986486; Wed, 17 Jun 2020 20:13:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592449986; cv=none; d=google.com; s=arc-20160816; b=hlNPa0JWmxbKBOn69if9Foq24NOxNs4++GJ4Qg6ZpsGOWTUUjiZiZTNbhsQpY+0fe0 qPuVkJuXbvGVsHMDMR/eqwWJMy5smFMrOVEAXSgvgIxuK75/hw7Cww9bkcpAo3dtfJME 2zGH23qT0S2g3KKNAcEOZ4H/d2yq4di+AU+MK9cOLWKUi8wYJ1R1qh/eD6BnIQ778k19 ciN4N14nJqX+3x/ewFgT+rLuXy3fTy2crUoMXgs3Z/7aOvpUZLVdeM1y5gKCcpukehX1 WdpDOnCTQ1kejTm3Nu/oPJcER/iOODWfL2fF5S+YKtF3E6WLbAoWzkfMU+S0COE121dJ caOw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=MGL0VPF6UC2ddargEBayjcTmQpiExD+zn2EWqDm0RqI=; b=LDbk29n0xWctq3GHuXFOEdo9QKLZX3nqAtqznx8DKsGW0VsgcG359AOf1BvQzFMBr0 T3M8rhrkV2E/xPfe2aTMnLqIT5/WYLSPlRiVua3wrOneb4Y1HidLjsBZP4eZf8xzYF9F 9uAp8WJFVAMpSGJ8JuBjaNR+9rHyLVea+ZbL0ifenmB0LKaxXxqjnE95Xok5Fv5FLh/D 7h3ohQSSftuBsHO0iBec+gjc9I3UVRKe3mewWFF5RWWfEN0xrAm7diObmnw1zbbx07UB mBbbO606OVpCk+swZY8lXhqmqjOcO6rLDbxy1tTlVRS8ZZF+VyBet62ObGGwMny+m/lW 5KAw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p13si1042151ejf.178.2020.06.17.20.12.36; Wed, 17 Jun 2020 20:13:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727774AbgFRDGO (ORCPT + 99 others); Wed, 17 Jun 2020 23:06:14 -0400 Received: from [211.29.132.246] ([211.29.132.246]:57138 "EHLO mail104.syd.optusnet.com.au" rhost-flags-FAIL-FAIL-OK-OK) by vger.kernel.org with ESMTP id S1726952AbgFRDGN (ORCPT ); Wed, 17 Jun 2020 23:06:13 -0400 Received: from dread.disaster.area (unknown [49.180.124.177]) by mail104.syd.optusnet.com.au (Postfix) with ESMTPS id B8369821885; Thu, 18 Jun 2020 13:05:47 +1000 (AEST) Received: from dave by dread.disaster.area with local (Exim 4.92.3) (envelope-from ) id 1jlkrz-0002Nn-SF; Thu, 18 Jun 2020 13:05:39 +1000 Date: Thu, 18 Jun 2020 13:05:39 +1000 From: Dave Chinner To: Masayoshi Mizuma Cc: "J. Bruce Fields" , Eric Sandeen , "Darrick J. Wong" , Christoph Hellwig , Theodore Ts'o , Andreas Dilger , Alexander Viro , Masayoshi Mizuma , linux-ext4@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-xfs Subject: Re: [PATCH] fs: i_version mntopt gets visible through /proc/mounts Message-ID: <20200618030539.GH2005@dread.disaster.area> References: <20200616202123.12656-1-msys.mizuma@gmail.com> <20200617080314.GA7147@infradead.org> <20200617155836.GD13815@fieldses.org> <24692989-2ee0-3dcc-16d8-aa436114f5fb@sandeen.net> <20200617172456.GP11245@magnolia> <8f0df756-4f71-9d96-7a52-45bf51482556@sandeen.net> <20200617181816.GA18315@fieldses.org> <4cbb5cbe-feb4-2166-0634-29041a41a8dc@sandeen.net> <20200617184507.GB18315@fieldses.org> <20200618013026.ewnhvf64nb62k2yx@gabell> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200618013026.ewnhvf64nb62k2yx@gabell> User-Agent: Mutt/1.10.1 (2018-07-13) X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.3 cv=QIgWuTDL c=1 sm=1 tr=0 a=k3aV/LVJup6ZGWgigO6cSA==:117 a=k3aV/LVJup6ZGWgigO6cSA==:17 a=kj9zAlcOel0A:10 a=nTHF0DUjJn0A:10 a=7-415B0cAAAA:8 a=yHdZGDY2jtx0MHS2ggIA:9 a=aBMfwiDfj0bUOVTI:21 a=1xHCqXNt3GIuuEAb:21 a=CjuIK1q_8ugA:10 a=biEYGPWJfzWAr4FL6Ov7:22 Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Wed, Jun 17, 2020 at 09:30:26PM -0400, Masayoshi Mizuma wrote: > On Wed, Jun 17, 2020 at 02:45:07PM -0400, J. Bruce Fields wrote: > > On Wed, Jun 17, 2020 at 01:28:11PM -0500, Eric Sandeen wrote: > > > but mount(8) has already exposed this interface: > > > > > > iversion > > > Every time the inode is modified, the i_version field will be incremented. > > > > > > noiversion > > > Do not increment the i_version inode field. > > > > > > so now what? > > > > It's not like anyone's actually depending on i_version *not* being > > incremented. (Can you even observe it from userspace other than over > > NFS?) > > > > So, just silently turn on the "iversion" behavior and ignore noiversion, > > and I doubt you're going to break any real application. > > I suppose it's probably good to remain the options for user compatibility, > however, it seems that iversion and noiversiont are useful for > only ext4. > How about moving iversion and noiversion description on mount(8) > to ext4 specific option? > > And fixing the remount issue for XFS (maybe btrfs has the same > issue as well)? > For XFS like as: > > diff --git a/fs/xfs/xfs_super.c b/fs/xfs/xfs_super.c > index 379cbff438bc..2ddd634cfb0b 100644 > --- a/fs/xfs/xfs_super.c > +++ b/fs/xfs/xfs_super.c > @@ -1748,6 +1748,9 @@ xfs_fc_reconfigure( > return error; > } > > + if (XFS_SB_VERSION_NUM(&mp->m_sb) == XFS_SB_VERSION_5) > + mp->m_super->s_flags |= SB_I_VERSION; > + > return 0; > } no this doesn't work, because the sueprblock flags are modified after ->reconfigure is called. i.e. reconfigure_super() does this: if (fc->ops->reconfigure) { retval = fc->ops->reconfigure(fc); if (retval) { if (!force) goto cancel_readonly; /* If forced remount, go ahead despite any errors */ WARN(1, "forced remount of a %s fs returned %i\n", sb->s_type->name, retval); } } WRITE_ONCE(sb->s_flags, ((sb->s_flags & ~fc->sb_flags_mask) | (fc->sb_flags & fc->sb_flags_mask))); And it's the WRITE_ONCE() line that clears SB_I_VERSION out of sb->s_flags. Hence adding it in ->reconfigure doesn't help. What we actually want to do here in xfs_fc_reconfigure() is this: if (XFS_SB_VERSION_NUM(&mp->m_sb) == XFS_SB_VERSION_5) fc->sb_flags_mask |= SB_I_VERSION; So that the SB_I_VERSION is not cleared from sb->s_flags. I'll also note that btrfs will need the same fix, because it also sets SB_I_VERSION unconditionally, as will any other filesystem that does this, too. Really, this is just indicative of the mess that the mount flags vs superblock feature flags are. Filesystems can choose to unconditionally support various superblock features, and no mount option futzing from userspace should -ever- be able to change that feature. Filesystems really do need to be able to override mount options that were parsed in userspace and turned into a binary flag... Cheers, Dave. -- Dave Chinner david@fromorbit.com