From c426c8b77ee1c506d7430f219a6a1f833c44b4e1 Mon Sep 17 00:00:00 2001 From: Barry Naujok Date: Thu, 30 Nov 2006 14:47:23 +0000 Subject: [PATCH] Fix up xfs_repair aborting if it finds an inode with an invalid inode type. Merge of master-melb:xfs-cmds:27589a by kenmcd. --- doc/CHANGES | 8 +++++--- repair/dinode.c | 20 +++++++++++++++----- 2 files changed, 20 insertions(+), 8 deletions(-) diff --git a/doc/CHANGES b/doc/CHANGES index f9b5e700c..a2d270893 100644 --- a/doc/CHANGES +++ b/doc/CHANGES @@ -1,6 +1,8 @@ xfsprogs-2.8.x - - Fix up libxfs initialisation with bad filesystem. - Thanks to Utako Kuzaka for this. + - Fix up libxfs SEGV when attempting to mount a non-XFS filesystem. + Thanks to Utako Kuzaka for this. + - Fix up xfs_repair aborting if it finds an inode with an invalid + inode type. xfsprogs-2.8.16 (30 October 2006) - Fix up an endian problem for nlink setting in phase 7 for xfs_repair. @@ -12,7 +14,7 @@ xfsprogs-2.8.15 (19 October 2006) xfsprogs-2.8.14 (6 October 2006) - Fix up the ring command in xfs_db, - Thanks to Utako Kuzaka for this. + Thanks to Utako Kuzaka for this. - Set the blocksize on the device to the given sector size which is _not_ necessarily 512 bytes; idea suggested by Shailendra Tripathi. diff --git a/repair/dinode.c b/repair/dinode.c index c4648f240..b23731978 100644 --- a/repair/dinode.c +++ b/repair/dinode.c @@ -2060,11 +2060,21 @@ process_dinode_int(xfs_mount_t *mp, type = XR_INO_FIFO; break; default: - type = XR_INO_UNKNOWN; - do_warn(_("Unexpected inode type %#o inode %llu\n"), - (int) (INT_GET(dinoc->di_mode, ARCH_CONVERT) & S_IFMT), lino); - abort(); - break; + retval++; + if (!verify_mode) { + do_warn(_("bad inode type %#o inode %llu\n"), + (int) (INT_GET(dinoc->di_mode, ARCH_CONVERT) & S_IFMT), lino); + if (!no_modify) + *dirty += clear_dinode(mp, dino, lino); + else + *dirty = 1; + *cleared = 1; + *used = is_free; + } else if (!uncertain) { + do_warn(_("bad inode type %#o inode %llu\n"), + (int) (INT_GET(dinoc->di_mode, ARCH_CONVERT) & S_IFMT), lino); + } + return 1; } /* -- 2.47.2