Received: by 10.223.185.116 with SMTP id b49csp5225116wrg; Wed, 7 Mar 2018 08:16:31 -0800 (PST) X-Google-Smtp-Source: AG47ELsmQGsC6xz6KiM3TXGdinh3gwFN3kmYvWiQk1LctWqFsJk/Q8C9rk5hghhmcx6Pn6vKRgGG X-Received: by 10.167.129.195 with SMTP id c3mr23057781pfn.14.1520439391499; Wed, 07 Mar 2018 08:16:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520439391; cv=none; d=google.com; s=arc-20160816; b=XMWYvHu3jm2Ip9+QmanpKrlVMGwN+i5OxR11EbMDmYL/lOpZEyM2LrwDmvW0XLcvGa BMFi1pBYKd1B8UMWGWuOuVuUMkHGNSenz2k3kR8XZ5M38o4j2lZsqqohrtbbUqTkgj0o vlj/93nMcQtBB2o/Dexrbor+LeuoiMa6kCdqrECbQcIDuqQYmb7Btb4WS005edRh7R58 IelOp4/4ztNmiRJUAy7WdUIRYkqyG77nDMnNthL1IwQy+Ua5VPPW2VRePC88dH7o+F78 kglmIRIZjN0M4ZAtABqIeTx7eiLeOhcQ9DxrK4qiKus38C2A/o0SqL7XyTRYZ1zyEydS qHuQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:from:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:to :date:arc-authentication-results; bh=D0LJs4wkPaeJWDqnAX6jy9IEWfJgubTntDd3Tkc5CYA=; b=uv1IijWo8ykVGnfxJ62uFkKm7mEcJdRXszE/X5s3RqlgaLKVtQceZcO7JUrfli/PCy 3HCF4vAEOusJKoGKBjhzdG637l2iB/rC0P6Lg1XiRKgKdSEKY62mhRTFeELJzJcYL2m+ 1wGebYh27KbY7x5nRMxTV/nkwjUkqMY0Rk5wazNyKuPtOLhAEwsWJsUfeggv/KmvmeSM obmvbw3FsY94ji0VIhaEm2xp4ORI8aW47m6Ud5zPpLAcI0ZQdqlGWPrhZDXaQDl24+OF VJrEC1C1UPnMesDgjqnwAszE2COjLKif2V77cH+NFUpLbrNExN/Z3yYWTONctJ+8pDCN 5zpw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=csclub.uwaterloo.ca Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l131si11526263pga.536.2018.03.07.08.16.16; Wed, 07 Mar 2018 08:16:31 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=csclub.uwaterloo.ca Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933894AbeCGQPS (ORCPT + 99 others); Wed, 7 Mar 2018 11:15:18 -0500 Received: from caffeine.csclub.uwaterloo.ca ([129.97.134.17]:34353 "EHLO caffeine.csclub.uwaterloo.ca" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933335AbeCGQPQ (ORCPT ); Wed, 7 Mar 2018 11:15:16 -0500 Received: by caffeine.csclub.uwaterloo.ca (Postfix, from userid 20367) id 0B2BFC008E; Wed, 7 Mar 2018 11:15:15 -0500 (EST) Date: Wed, 7 Mar 2018 11:15:15 -0500 To: "Theodore Y. Ts'o" , Andreas Dilger , linux-ext4@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: ext4 ignoring rootfs default mount options Message-ID: <20180307161515.n76esxdqfdz5ho7h@csclub.uwaterloo.ca> References: <20180306190315.puocf5bu3bfz6yct@csclub.uwaterloo.ca> <20180307040608.GA2462@thunk.org> <20180307151427.i6vbeq6kqo55cdgs@csclub.uwaterloo.ca> <20180307160856.GD7507@thunk.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180307160856.GD7507@thunk.org> User-Agent: NeoMutt/20170113 (1.7.2) From: lsorense@csclub.uwaterloo.ca (Lennart Sorensen) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Mar 07, 2018 at 11:08:56AM -0500, Theodore Y. Ts'o wrote: > This is where it's critcal to understand that the "tune2fs -o" changes > the *default* mount options. The key in the comment is the anything > different from the *filesystem* defaults (that is, the defaults of the > particular ext4 file system, as opposed to the global defaults). The > idea is that /proc/mounts, and /etc/mtab shows the options string that > if used in /etc/fstab, or in the mount command line, will replicate > the current mount option state. Furthermore, that /proc/mounts is the > minimal set of mount option strings. > > You may not like the behavior, but it's been this way forever, and the > reasoning behind it is that the low-level file system code doesn't > really know what the actual mount option string that would be in > /etc/fstab or in the /sbin/mount command line. That's because > /sbin/mount command actually parses the mount options, and things like > "ro" is actually translated into bitflag passed to the mount option. > So for example, it's impossible to know whether "rw" was in the > user-specified mount string, since we never see it by the time the > string gets sent to ext4_fill_super (in fact the kernel never sees > it). So when we try to make /proc/mounts a replacement for /etc/mtab > (since some people make /etc/mtab as symlink /proc/mounts), it's > actually impossible. Trying to make it be the minimal set of options > was at least a consitent thing. That is, if you use "tune2fs -o > nodelalloc", it's not necessary to put nodelalloc in /etc/fstab or in > the mount command line. And hence, it should not be in /proc/mounts. OK, that makes sense. Thanks. I will work on convincing myself this is how it should be. > As far as where ext4_seq_options_show() gets called, it's because we > have a fair amount of macro shortcuts in fs/ext4/sysfs.c (which is > where we put all of the pseudo file system support for ext4, which > means it includes procfs). Search for macros PROC_FILE_SHOW_DEFN and > PROC_FILE_LIST. Oh that's where it is. -- Len Sorensen