[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20170708153341.i7h6wma6hykhz5jc@thunk.org>
Date: Sat, 8 Jul 2017 11:33:41 -0400
From: Theodore Ts'o <tytso@....edu>
To: David Howells <dhowells@...hat.com>
Cc: "Eric W. Biederman" <ebiederm@...ssion.com>,
viro@...iv.linux.org.uk, linux-fsdevel@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [RFC][PATCH 00/14] VFS: Make all filesystems implement
->show_options()
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
Powered by blists - more mailing lists