From b720c3e2bbdb097c1d13a424ed6c4c06c5f6b52e Mon Sep 17 00:00:00 2001
From: jdolecek <jdolecek@NetBSD.org>
Date: Mon, 15 Aug 2016 18:57:06 +0000
Subject: [PATCH] adjust inode size check to compare against
 EXT2_REV0_DINODE_SIZE, rather then sizeof(struct ext2fs_dinode), as the
 structure definition was expanded with the optional fields

---
 sbin/fsck_ext2fs/setup.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/sbin/fsck_ext2fs/setup.c b/sbin/fsck_ext2fs/setup.c
index f4fbb2b278d1..508527bc0edc 100644
--- a/sbin/fsck_ext2fs/setup.c
+++ b/sbin/fsck_ext2fs/setup.c
@@ -1,4 +1,4 @@
-/*	$NetBSD: setup.c,v 1.33 2016/08/15 18:42:15 jdolecek Exp $	*/
+/*	$NetBSD: setup.c,v 1.34 2016/08/15 18:57:06 jdolecek Exp $	*/
 
 /*
  * Copyright (c) 1980, 1986, 1993
@@ -58,7 +58,7 @@
 #if 0
 static char sccsid[] = "@(#)setup.c	8.5 (Berkeley) 11/23/94";
 #else
-__RCSID("$NetBSD: setup.c,v 1.33 2016/08/15 18:42:15 jdolecek Exp $");
+__RCSID("$NetBSD: setup.c,v 1.34 2016/08/15 18:57:06 jdolecek Exp $");
 #endif
 #endif /* not lint */
 
@@ -306,7 +306,7 @@ readsb(int listerr)
 	}
 	if (sblock.e2fs.e2fs_rev > E2FS_REV0 &&
 	    (!powerof2(sblock.e2fs.e2fs_inode_size) ||
-	     sblock.e2fs.e2fs_inode_size < sizeof(struct ext2fs_dinode) ||
+	     sblock.e2fs.e2fs_inode_size < EXT2_REV0_DINODE_SIZE ||
 	     sblock.e2fs.e2fs_inode_size >
 	      (1024 << sblock.e2fs.e2fs_log_bsize))) {
 		badsb(listerr, "BAD INODE_SIZE");