Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp656365ybt; Wed, 17 Jun 2020 10:26:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwXR9jed+mFPBKKETyibCRTTSf99PKZRemLgTxXAJRP3aSPvP+F5kOKvI1XUeP8JfDKwCSv X-Received: by 2002:a17:906:fa92:: with SMTP id lt18mr192275ejb.423.1592414811193; Wed, 17 Jun 2020 10:26:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592414811; cv=none; d=google.com; s=arc-20160816; b=B8jquPmn1nA0g8Cv/RhsmSobrWLg4/1rXoNYb5qwVZigZ+Q6z9y173b9R6AEb7XhRK GD6krcGSKlOSLEIywXb7PgDgYZbyiHZq5Z6CuC0PeI/XNnlqarQfHoMwUNufx1dM4yZd y8pF8vHxkLQs7WP6FXUz6v2/JW6hIrfZWQuSNlgVmdT2WJ/72vcdxWMFi0leyk5bhhpY /CMX64d8H+fbFSXu6d0r9UDo6ZD/dWUdZt7gmhfGilqpvsRJNJUBvNDL50DsaeosUIj7 Xo+rAObICCop6QDyQMV/LLy03z81k0M9XEQ7mETq2OHNvd+DhRBDS//0L2GtSbQ561/7 SY0A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=vaqCbfBg7wUUEyEQckcjkAnwkivK2JLBmbqfA8T87Kc=; b=b5lexD3cdNP6SlMdi9TkAyNahmHbuD/rMh9SQdd8oLVf0jBvhSmfm1sc0lQgGBLKJU Qe9TZrDLmSgc28QHIlYFJ+P/M/4q49iG3Lprquxg4NOJI3I37CMRt574enj51B1e83Kb csA2u8PJAtg0FkLYfpuX/zuVETauzoJ3N/t1hnaRDBJAld4umBgsX6z8hsEzt/EqkQ3c hMzjKC4zDyYMHw6z7Usxa/vewHZDvHgm7LppDMZvDaD8X3tgIXfy/nfRgylrPPvGTWIi BpkPouOTT4GyudkUKlgtImkL2ZPtzKbjO0IcTsMGh1D66298jLWC1UNDdbW6FHBC86qq OCYw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2020-01-29 header.b=rG8h6sCe; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y7si358255edm.24.2020.06.17.10.26.23; Wed, 17 Jun 2020 10:26:51 -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; dkim=pass header.i=@oracle.com header.s=corp-2020-01-29 header.b=rG8h6sCe; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726906AbgFQRZa (ORCPT + 99 others); Wed, 17 Jun 2020 13:25:30 -0400 Received: from userp2120.oracle.com ([156.151.31.85]:52214 "EHLO userp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726496AbgFQRZa (ORCPT ); Wed, 17 Jun 2020 13:25:30 -0400 Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 05HHHZAb147328; Wed, 17 Jun 2020 17:25:09 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=date : from : to : cc : subject : message-id : references : mime-version : content-type : in-reply-to; s=corp-2020-01-29; bh=vaqCbfBg7wUUEyEQckcjkAnwkivK2JLBmbqfA8T87Kc=; b=rG8h6sCevPtv2KlllhQDfmP+E3ChsjFwqqsNHJ5qz0D9aHfcL571SW86fjqFRfwIF3zj XM8kYmPCoqzhlKsN/DguYZNLNmeYL/290isRUXlQN3gG27fAa06sUquJi3akTjeOmvZR 8uo0KCskWSaqPP73kaGAGICKH4GaaMIXdo9kIOcsU2VDS9dR/DTpxF0Qew7z8qdz/dj8 H2ojM2cvbTh+pOabFElR4OVLlBI4UG99iBI8wxni17tzoecQdIemJ7tigXXW2K0nAAut GtjMXJPO0OBNtRZ1+RvYabyKxR/vfHLtc5YYqwLhwLKLNrih/vo6/eTsrm9DLZih4dnF Ig== Received: from userp3020.oracle.com (userp3020.oracle.com [156.151.31.79]) by userp2120.oracle.com with ESMTP id 31qg352nh9-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 17 Jun 2020 17:25:07 +0000 Received: from pps.filterd (userp3020.oracle.com [127.0.0.1]) by userp3020.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 05HHHebS126726; Wed, 17 Jun 2020 17:25:07 GMT Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by userp3020.oracle.com with ESMTP id 31q65xxndx-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 17 Jun 2020 17:25:07 +0000 Received: from abhmp0002.oracle.com (abhmp0002.oracle.com [141.146.116.8]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id 05HHOvlB021565; Wed, 17 Jun 2020 17:24:58 GMT Received: from localhost (/10.159.233.73) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Wed, 17 Jun 2020 10:24:57 -0700 Date: Wed, 17 Jun 2020 10:24:56 -0700 From: "Darrick J. Wong" To: Eric Sandeen Cc: "J. Bruce Fields" , Christoph Hellwig , Masayoshi Mizuma , "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: <20200617172456.GP11245@magnolia> References: <20200616202123.12656-1-msys.mizuma@gmail.com> <20200617080314.GA7147@infradead.org> <20200617155836.GD13815@fieldses.org> <24692989-2ee0-3dcc-16d8-aa436114f5fb@sandeen.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <24692989-2ee0-3dcc-16d8-aa436114f5fb@sandeen.net> X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9655 signatures=668680 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999 spamscore=0 phishscore=0 bulkscore=0 malwarescore=0 mlxscore=0 adultscore=0 suspectscore=1 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2004280000 definitions=main-2006170137 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9655 signatures=668680 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 bulkscore=0 phishscore=0 mlxscore=0 clxscore=1011 malwarescore=0 impostorscore=0 adultscore=0 cotscore=-2147483648 lowpriorityscore=0 mlxlogscore=999 spamscore=0 suspectscore=1 priorityscore=1501 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2004280000 definitions=main-2006170137 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 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 > >>> > >>> /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 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? > > > > 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 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... --D > -Eric > > > Ideally there'd be entirely different fields for mount options and > > internal feature flags. But I don't know, maybe SB_I_VERSION is the > > only flag we have like this. > > > > --b. > >