From ba24d9570a91fbeae0c5f50d4dd49fb75f023cbe Mon Sep 17 00:00:00 2001 From: Glen Overby Date: Thu, 15 Dec 2005 19:01:13 +0000 Subject: [PATCH] xfs_db shouldn't give up just because it can't read the root inode. Try reading it, but if the read fails (for example, because of a corrupt inode) then proceed without reading the root inode. fall back to a mount without reading the root inode if the mount with reading and checking the root inode fails. --- db/init.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/db/init.c b/db/init.c index d6ee8b535..f2d60a9ed 100644 --- a/db/init.c +++ b/db/init.c @@ -126,9 +126,13 @@ init( mp = libxfs_mount(&xmount, sbp, x.ddev, x.logdev, x.rtdev, LIBXFS_MOUNT_ROOTINOS | LIBXFS_MOUNT_DEBUGGER); if (!mp) { - dbprintf(_("%s: device %s unusable (not an XFS filesystem?)\n"), + mp = libxfs_mount(&xmount, sbp, x.ddev, x.logdev, x.rtdev, + LIBXFS_MOUNT_DEBUGGER); + if (!mp) { + dbprintf(_("%s: device %s unusable (not an XFS filesystem?)\n"), progname, fsdevice); - exit(1); + exit(1); + } } blkbb = 1 << mp->m_blkbb_log; -- 2.47.2