Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 4 Mar 2019 11:12:20 +0000 (UTC)
From:      Fedor Uporov <fsu@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r344754 - head/sys/fs/ext2fs
Message-ID:  <201903041112.x24BCKbR021179@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: fsu
Date: Mon Mar  4 11:12:19 2019
New Revision: 344754
URL: https://svnweb.freebsd.org/changeset/base/344754

Log:
  Do not panic if inode bitmap is corrupted.
  
  admbug:         804
  Reported by:    Ilja Van Sprundel <ivansprundel@ioactive.com>
  Reviewed by:    pfg
  MFC after:      1 week
  
  Differential Revision:    https://reviews.freebsd.org/D19325

Modified:
  head/sys/fs/ext2fs/ext2_alloc.c

Modified: head/sys/fs/ext2fs/ext2_alloc.c
==============================================================================
--- head/sys/fs/ext2fs/ext2_alloc.c	Mon Mar  4 11:01:23 2019	(r344753)
+++ head/sys/fs/ext2fs/ext2_alloc.c	Mon Mar  4 11:12:19 2019	(r344754)
@@ -1318,10 +1318,12 @@ ext2_nodealloccg(struct inode *ip, int cg, daddr_t ipr
 		start = 0;
 		loc = memcchr(&ibp[start], 0xff, len);
 		if (loc == NULL) {
-			printf("cg = %d, ipref = %lld, fs = %s\n",
+			printf("ext2fs: inode bitmap corrupted: "
+			    "cg = %d, ipref = %lld, fs = %s - run fsck\n",
 			    cg, (long long)ipref, fs->e2fs_fsmnt);
-			panic("ext2fs_nodealloccg: map corrupted");
-			/* NOTREACHED */
+			brelse(bp);
+			EXT2_LOCK(ump);
+			return (0);
 		}
 	}
 	ipref = (loc - ibp) * NBBY + ffs(~*loc) - 1;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201903041112.x24BCKbR021179>