From: Brian Foster <bfoster@redhat.com>
To: Eric Sandeen <sandeen@sandeen.net>
Cc: "Darrick J. Wong" <darrick.wong@oracle.com>,
Alex Lyakas <alex@zadara.com>,
linux-xfs@vger.kernel.org, Dave Chinner <david@fromorbit.com>
Subject: Re: [RFC-PATCH] xfs: do not update sunit/swidth in the superblock to match those provided during mount
Date: Mon, 25 Nov 2019 08:07:52 -0500 [thread overview]
Message-ID: <20191125130752.GB44777@bfoster> (raw)
In-Reply-To: <c807e9fb-3ad9-7110-fd5d-29b07a3d1c66@sandeen.net>
On Sun, Nov 24, 2019 at 11:38:53AM -0600, Eric Sandeen wrote:
> On 11/24/19 10:40 AM, Darrick J. Wong wrote:
> > On Sun, Nov 24, 2019 at 11:13:09AM +0200, Alex Lyakas wrote:
>
> ...
>
> >>>> With the suggested patch, xfs repair is working properly also when mount-provided sunit/swidth are different.
> >>>>
> >>>> However, I am not sure whether this is the proper approach.
> >>>> Otherwise, should we not allow specifying different sunit/swidth
> >>>> during mount?
> >
> > I propose a (somewhat) different solution to this problem:
> >
> > Port to libxfs the code that determines where mkfs/repair expect the
> > root inode. Whenever we want to update the geometry information in the
> > superblock from mount options, we can test the new ones to see if that
> > would cause sb_rootino to change. If there's no change, we update
> > everything like we do now. If it would change, either we run with those
> > parameters incore only (which I think is possible for su/sw?) or refuse
> > them (because corruption is bad).
> >
> > This way we don't lose the su/sw updating behavior we have now, and we
> > also gain the ability to shut down an entire class of accidental sb
> > geometry corruptions.
>
Indeed, I was thinking about something similar with regard to
validation. ISTM that we either need some form of runtime validation...
> I also wonder if we should be putting so much weight on the root inode
> location in repair, or if we could get away with other consistency checks
> to be sure it's legit, since we've always been able to move the
> "expected" Location.
>
... or to fix xfs_repair. ;) Fixing the latter seems ideal to me, but
I'm not sure how involved that is compared to a runtime fix. Clearly the
existing repair check is not a sufficient corruption check on its own.
Perhaps we could validate the inode pointed to by the superblock in
general and if that survives, verify it looks like a root directory..?
The unexpected location thing could still be a (i.e. bad alignment)
warning, but that's probably a separate topic.
I'm not opposed to changing runtime behavior even with a repair fix,
fwiw. I wonder if conditionally updating the superblock is the right
behavior as it might be either too subtle for users or too disruptive if
some appliance out there happens to use a mount cycle to update su/sw.
Failing the mount seems preferable, but raises similar questions wrt to
changing behavior. Yes, it is corruption otherwise, but unless I'm
missing something it seems like a pretty rare corner case (e.g. how many
people change alignment like this? of those that do, how many ever run
xfs_repair?). To me, the ideal behavior is for mount options to always
dictate runtime behavior and for a separate admin tool or script to make
persistent changes (with associated validation) to the superblock.
Brian
next prev parent reply other threads:[~2019-11-25 13:08 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-11-21 18:08 [RFC-PATCH] xfs: do not update sunit/swidth in the superblock to match those provided during mount Alex Lyakas
2019-11-22 15:43 ` Brian Foster
2019-11-24 9:13 ` Alex Lyakas
2019-11-24 16:40 ` Darrick J. Wong
2019-11-24 17:38 ` Eric Sandeen
2019-11-25 13:07 ` Brian Foster [this message]
2019-11-26 8:50 ` Alex Lyakas
2019-11-25 13:07 ` Brian Foster
2019-11-26 8:49 ` Alex Lyakas
2019-11-26 11:54 ` Brian Foster
2019-11-26 13:37 ` Alex Lyakas
2019-11-26 16:53 ` Eric Sandeen
2019-11-27 14:19 ` Christoph Hellwig
2019-11-27 15:19 ` Brian Foster
2019-11-30 20:28 ` Dave Chinner
2019-12-01 9:00 ` Alex Lyakas
2019-12-01 21:57 ` Dave Chinner
2019-12-02 8:07 ` Alex Lyakas
2019-12-01 23:29 ` Dave Chinner
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20191125130752.GB44777@bfoster \
--to=bfoster@redhat.com \
--cc=alex@zadara.com \
--cc=darrick.wong@oracle.com \
--cc=david@fromorbit.com \
--cc=linux-xfs@vger.kernel.org \
--cc=sandeen@sandeen.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.