xfs_repair: don't crash on -vv
PATCH 1/1 xfs_repair: don't crash on -vv
From: Darrick J. Wong <[email protected]>
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 <[email protected]>
Signed-off-by Darrick J. Wong <[email protected]>
--- repair/progress.c | 2 +- repair/xfs_repair.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
repair/progress.c +1 -1
@@ -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 );
repair/xfs_repair.c +1 -1
@@ -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;
Looks good:
Reviewed-by Christoph Hellwig <[email protected]>