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 <ivansprun...@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;
_______________________________________________
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to