From: Glen Overby Date: Thu, 15 Dec 2005 19:01:13 +0000 (+0000) Subject: xfs_db shouldn't give up just because it can't read the root inode. Try X-Git-Tag: v2.8.0~46 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ba24d9570a91fbeae0c5f50d4dd49fb75f023cbe;p=thirdparty%2Fxfsprogs-dev.git 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. --- 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;