From: "Darrick J. Wong" <darrick.wong@oracle.com>
To: Eric Sandeen <sandeen@sandeen.net>
Cc: linux-xfs@vger.kernel.org, alex@zadara.com
Subject: Re: [PATCH 5/6] xfs_repair: check plausibility of root dir pointer before trashing it
Date: Thu, 30 Jan 2020 12:34:48 -0800 [thread overview]
Message-ID: <20200130203448.GF3447196@magnolia> (raw)
In-Reply-To: <4fb8e608-959e-813a-2424-865a765a2b92@sandeen.net>
On Thu, Jan 30, 2020 at 02:18:52PM -0600, Eric Sandeen wrote:
> On 1/23/20 6:17 PM, Darrick J. Wong wrote:
> > From: Darrick J. Wong <darrick.wong@oracle.com>
> >
> > If sb_rootino doesn't point to where we think mkfs should have allocated
> > the root directory, check to see if the alleged root directory actually
> > looks like a root directory. If so, we'll let it live because someone
> > could have changed sunit since formatting time, and that changes the
> > root directory inode estimate.
>
> I forget, is there an fstest for this?
https://lore.kernel.org/linux-xfs/20191218041831.GK12765@magnolia/
> > Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
>
> ...
>
> > @@ -438,6 +469,20 @@ calc_mkfs(
> >
> > rootino = libxfs_ialloc_calc_rootino(mp, mp->m_sb.sb_unit);
> >
> > + /*
> > + * If the root inode isn't where we think it is, check its plausibility
> > + * as a root directory. It's possible that somebody changed sunit
> > + * since the filesystem was created, which can change the value of the
> > + * above computation. Don't blow up the root directory if this is the
> > + * case.
> > + */
> > + if (mp->m_sb.sb_rootino != rootino && has_plausible_rootdir(mp)) {
> > + do_warn(
> > +_("sb root inode value %" PRIu64 " inconsistent with alignment (expected %"PRIu64")\n"),
> > + mp->m_sb.sb_rootino, rootino);
>
> what would a user do with this warning? Is there any value in emitting it?
>
> Otherwise this looks good.
I dunno -- on the one hand, I understand that nobody wants to deal with
the support calls that will erupt from that message. On the other hand,
it's an indication that this filesystem isn't /quite/ the way we
expected it to be, and that would be a helpful hint if you were
debugging some other weird problem with an xfs filesystem.
What if this were a do_log()?
--D
>
>
> > + rootino = mp->m_sb.sb_rootino;
> > + }
> > +
> > ensure_fixed_ino(&mp->m_sb.sb_rootino, rootino,
> > _("root"));
> > ensure_fixed_ino(&mp->m_sb.sb_rbmino, rootino + 1,
> >
next prev parent reply other threads:[~2020-01-30 20:34 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-01-24 0:17 [PATCH v3 0/6] xfs_repair: do not trash valid root dirs Darrick J. Wong
2020-01-24 0:17 ` [PATCH 1/6] mkfs: check root inode location Darrick J. Wong
2020-01-30 19:32 ` Eric Sandeen
2020-01-30 20:19 ` Darrick J. Wong
2020-01-30 20:34 ` Eric Sandeen
2020-01-24 0:17 ` [PATCH 2/6] xfs_repair: enforce that inode btree chunks can't point to AG headers Darrick J. Wong
2020-01-30 19:38 ` Eric Sandeen
2020-01-30 20:26 ` Darrick J. Wong
2020-01-30 20:46 ` Eric Sandeen
2020-01-24 0:17 ` [PATCH 3/6] xfs_repair: refactor fixed inode location checks Darrick J. Wong
2020-01-30 19:45 ` Eric Sandeen
2020-01-30 19:52 ` Eric Sandeen
2020-01-24 0:17 ` [PATCH 4/6] xfs_repair: use libxfs function to calculate root inode location Darrick J. Wong
2020-01-30 19:48 ` Eric Sandeen
2020-01-24 0:17 ` [PATCH 5/6] xfs_repair: check plausibility of root dir pointer before trashing it Darrick J. Wong
2020-01-30 20:18 ` Eric Sandeen
2020-01-30 20:34 ` Darrick J. Wong [this message]
2020-01-30 20:41 ` Eric Sandeen
2020-01-30 20:50 ` Darrick J. Wong
2020-01-24 0:18 ` [PATCH 6/6] xfs_repair: try to correct sb_unit value from secondaries Darrick J. Wong
-- strict thread matches above, loose matches on Subject: below --
2020-01-01 1:20 [PATCH v2 0/6] xfs_repair: do not trash valid root dirs Darrick J. Wong
2020-01-01 1:21 ` [PATCH 5/6] xfs_repair: check plausibility of root dir pointer before trashing it Darrick J. Wong
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=20200130203448.GF3447196@magnolia \
--to=darrick.wong@oracle.com \
--cc=alex@zadara.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox