From: "Darrick J. Wong" <djwong@kernel.org>
To: Carlos Maiolino <cem@kernel.org>
Cc: Santiago Kraus <santiago_kraus@yahoo.com>,
tobias.powalowski@googlemail.com, xfs <linux-xfs@vger.kernel.org>
Subject: [PATCH] xfs_repair: don't crash on -vv
Date: Mon, 29 Jul 2024 12:19:55 -0700 [thread overview]
Message-ID: <20240729191955.GC6374@frogsfrogsfrogs> (raw)
From: Darrick J. Wong <djwong@kernel.org>
A user reported a crash in xfs_repair when they run it with -vv
specified on the command line. Ultimately this harks back to xfs_m in
main() containing uninitialized stack contents, and inadequate null
checks. Fix both problems in one go.
Reported-by: Santiago Kraus <santiago_kraus@yahoo.com>
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
---
repair/progress.c | 2 +-
repair/xfs_repair.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/repair/progress.c b/repair/progress.c
index 07cf4e4f2baf..74e7a671962e 100644
--- a/repair/progress.c
+++ b/repair/progress.c
@@ -394,7 +394,7 @@ timestamp(
time_t now;
struct tm *tmp;
- if (verbose > 1 && mp && mp->m_ddev_targp)
+ if (verbose > 1 && mp && mp->m_ddev_targp && mp->m_ddev_targp->bcache)
cache_report(stderr, "libxfs_bcache", mp->m_ddev_targp->bcache);
now = time(NULL);
diff --git a/repair/xfs_repair.c b/repair/xfs_repair.c
index 39884015300a..e325d61f1036 100644
--- a/repair/xfs_repair.c
+++ b/repair/xfs_repair.c
@@ -1029,7 +1029,7 @@ main(int argc, char **argv)
xfs_mount_t *temp_mp;
xfs_mount_t *mp;
struct xfs_buf *sbp;
- xfs_mount_t xfs_m;
+ struct xfs_mount xfs_m = { };
struct xlog log = {0};
char *msgbuf;
struct xfs_sb psb;
next reply other threads:[~2024-07-29 19:19 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-29 19:19 Darrick J. Wong [this message]
2024-07-29 20:12 ` [PATCH] xfs_repair: don't crash on -vv Christoph Hellwig
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=20240729191955.GC6374@frogsfrogsfrogs \
--to=djwong@kernel.org \
--cc=cem@kernel.org \
--cc=linux-xfs@vger.kernel.org \
--cc=santiago_kraus@yahoo.com \
--cc=tobias.powalowski@googlemail.com \
/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.