]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
xfs_db shouldn't give up just because it can't read the root inode. Try
authorGlen Overby <overby@sgi.com>
Thu, 15 Dec 2005 19:01:13 +0000 (19:01 +0000)
committerGlen Overby <overby@sgi.com>
Thu, 15 Dec 2005 19:01:13 +0000 (19:01 +0000)
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

index d6ee8b535cb1b154dfe02249a198d225ae63b3cd..f2d60a9ed2da878d4850fefa6f9f055bdfdd4b88 100644 (file)
--- 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;