From: Eric Sandeen <sandeen@redhat.com>
To: Brian Foster <bfoster@redhat.com>,
"Darrick J. Wong" <darrick.wong@oracle.com>
Cc: linux-xfs@vger.kernel.org
Subject: Re: [PATCH v3 4/5] xfs_db: sanitize geometry on load
Date: Fri, 13 Jan 2017 20:25:47 -0600 [thread overview]
Message-ID: <b071967b-e67b-2280-156c-9a5aeaa5d40c@redhat.com> (raw)
In-Reply-To: <20170113133542.GB22013@bfoster.bfoster>
On 1/13/17 7:35 AM, Brian Foster wrote:
>> + fprintf(stderr,
>> +_("%s: device %s AG count is insane, but could be %u. Limiting reads to AG 0.\n"),
>> + progname, fsdevice, dblocks / sbp->sb_agblocks);
>> + } else {
>> + fprintf(stderr,
>> +_("%s: device %s AG count is insane. Limiting reads to AG 0.\n"),
>> + progname, fsdevice);
>> + }
> For reasons like the above, I think xfs_db shouldn't be in the business
> of repair like validation (xfs_check notwithstanding). That said,
> dropping into a fixed single AG mode seems less risky than trying to
> surmise a valid geometry. I'd get rid of the "this might be your
> agcount" messaging entirely though and just replace it with something
> that explicitly states the filesystem is corrupted, the runtime geometry
> is invalid and that the user should probably run xfs_repair before doing
> anything.
So keep in mind that xfs_db is for people with super xfs powers. (*)
I wouldn't suggest repair, I'd start with 1 ag to avoid the OOM, state
that clearly, and punt the problem to the admin with no other specific
suggestions.
> I still like the idea of the single AG mode thing as a command line flag
> rather than default behavior because it requires user acknowledgement,
> but this is a debug tool after all, so I'll defer to Eric on that. I do
> think that if we create this kind of invalid runtime mode, this should
> be split into two patches. First, a bugfix patch for the core OOM
> problem (i.e., detect a wacky superblock and exit). Second, replace the
> exit with the single AG runtime mode thing.
Well, the problem with a flag, I think, is that you might have already
unwittingly OOMed your box to find out that you need it.
Rebooting to try again with a flag sucks.
(*) unless you are invoking it via xfs_admin.sh, dammit. We sure wouldn't
want xfs_admin to exit happily, having updated only one AG. Dammit!
Perhaps it should set exitcode, and then xfs_admin could do something
like:
xfs_db -c quit $DEV
first, and check that db is able to initialize sanely before using it again
to perform normal admin functions.
-Eric
next prev parent reply other threads:[~2017-01-14 2:35 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-12 3:06 [PATCH 0/5] xfsprogs: misc fixes Darrick J. Wong
2017-01-12 3:06 ` [PATCH 1/5] xfs_io: fix the minimum arguments to the reflink command Darrick J. Wong
2017-01-12 13:53 ` Christoph Hellwig
2017-01-12 3:06 ` [PATCH 2/5] xfs_io: fix some documentation problems Darrick J. Wong
2017-01-12 13:53 ` Christoph Hellwig
2017-01-12 3:06 ` [PATCH 3/5] xfs_io: prefix dedupe command error messages consistently Darrick J. Wong
2017-01-12 13:53 ` Christoph Hellwig
2017-01-12 3:06 ` [PATCH 4/5] xfs_db: sanitize geometry on load Darrick J. Wong
2017-01-12 14:34 ` Eric Sandeen
2017-01-12 15:09 ` Brian Foster
2017-01-12 20:41 ` Darrick J. Wong
2017-01-12 20:41 ` [PATCH v2 " Darrick J. Wong
2017-01-12 23:20 ` Eric Sandeen
2017-01-13 0:23 ` Darrick J. Wong
2017-01-13 0:32 ` [PATCH v3 " Darrick J. Wong
2017-01-13 13:35 ` Brian Foster
2017-01-14 2:25 ` Eric Sandeen [this message]
2017-01-14 3:44 ` Brian Foster
2017-01-14 3:51 ` Eric Sandeen
2017-01-14 12:53 ` Brian Foster
2017-01-14 14:59 ` Eric Sandeen
2017-01-15 14:10 ` Brian Foster
2017-01-12 3:06 ` [PATCH 5/5] xfs_repair: strengthen geometry checks Darrick J. Wong
2017-01-14 2:13 ` Eric Sandeen
2017-01-20 20:06 ` Darrick J. Wong
2017-01-12 19:27 ` [PATCH 6/5] xfs_db: fix the 'source' command when passed as a -c option Darrick J. Wong
2017-01-12 19:34 ` [PATCH 7/5] xfs_repair.8: document dirty log conditions Darrick J. Wong
2017-01-12 19:41 ` Eric Sandeen
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=b071967b-e67b-2280-156c-9a5aeaa5d40c@redhat.com \
--to=sandeen@redhat.com \
--cc=bfoster@redhat.com \
--cc=darrick.wong@oracle.com \
--cc=linux-xfs@vger.kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).