Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752885AbdGHPdq (ORCPT ); Sat, 8 Jul 2017 11:33:46 -0400 Received: from imap.thunk.org ([74.207.234.97]:59356 "EHLO imap.thunk.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752715AbdGHPdp (ORCPT ); Sat, 8 Jul 2017 11:33:45 -0400 Date: Sat, 8 Jul 2017 11:33:41 -0400 From: "Theodore Ts'o" To: David Howells Cc: "Eric W. Biederman" , viro@zeniv.linux.org.uk, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [RFC][PATCH 00/14] VFS: Make all filesystems implement ->show_options() Message-ID: <20170708153341.i7h6wma6hykhz5jc@thunk.org> Mail-Followup-To: Theodore Ts'o , David Howells , "Eric W. Biederman" , viro@zeniv.linux.org.uk, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org References: <87tw2qetbf.fsf@xmission.com> <149926824154.20611.6104595541055328700.stgit@warthog.procyon.org.uk> <24033.1499443136@warthog.procyon.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <24033.1499443136@warthog.procyon.org.uk> User-Agent: NeoMutt/20170306 (1.8.0) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: tytso@thunk.org X-SA-Exim-Scanned: No (on imap.thunk.org); SAEximRunCond expanded to false Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1439 Lines: 32 On Fri, Jul 07, 2017 at 04:58:56PM +0100, David Howells wrote: > Yeah. We actually currently get this *wrong* in both ext4 and btrfs - and > probably other disk filesystems too. During ext4 remount and btrfs remount, > the options are parsed directly into the live xxx_fs_info struct, but if > there's a parse error mid-way, we only partially apply the options and have no > idea where it went wrong and what the current state is. > > What I'm looking it is breaking it down into a number of steps: > > (1) Parse the options one at a time into a context struct. > > (2) Once we've got all the options, validate the options we've been given > with respect to themselves. > > (3) Under lock: > > (a) Check the coherency of the options we've been given with respect to > the superblock (if new mount) or the current live state (if remount). > > (b) Apply the options. This is not permitted to fail. > > This gets more complicated under ext4 as you've got an extra option string > stored on disk that you also have to apply and combine with the options > presented to the mount interface. Remounts aren't really performance critical, so it might be simpler just to do one pass which just checks the options, applying the options to a scratch xx_fs_info struct, and if it seeded, redo the parse from scratch, this time applying to the live xxx_fs_info struct. - Ted