Skip to contentSkip to conversation

Unexpected inode type 0160000 causes abort of xfs_repair

DISCUSSION Barry Naujok 1 participant 1 message Dec 20, 2006

lore
Share & tools
lore
#0 lore raw

Can you try the attached patch and see how xfs_repair goes?

Quoted 18 lines

-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Jonathan Groll
Sent: Thursday, 23 November 2006 7:12 AM
To: [email protected]
Subject: Unexpected inode type 0160000 causes abort of xfs_repair

I'm unsuccesfully trying to repair an XFS filesystem

xfs_repair /dev/md1 and the same with -L both end with bad (negative) size -2150115811482766770 on inode 1539849750 cleared inode 1539849750
bad magic number 0x859b on inode 1539849751, resetting magic number bad version number 0xffffff88 on inode 1539849751, resetting version number
Unexpected inode type 0160000 inode 1539849751
Aborted

Quoted 10 lines

OS: debian sarge (stable)
Kernel: 2.6.15.7
xfsprogs 2.8.11-1

Is there anything I can possibly do?

Many thanks,
Jonathan Groll

xfsprogs/repair/dinode.c +15 -5
@@ -2060,11 +2060,21 @@
 		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;
 	}
 
 	/*