From a5764f71397396bd93073451fc588d5895b12023 Mon Sep 17 00:00:00 2001 From: jdolecek Date: Mon, 15 Aug 2016 19:13:24 +0000 Subject: [PATCH] more informative debug output for unsupported features --- sbin/fsck_ext2fs/setup.c | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/sbin/fsck_ext2fs/setup.c b/sbin/fsck_ext2fs/setup.c index 508527bc0edc..8ccfa0d679c9 100644 --- a/sbin/fsck_ext2fs/setup.c +++ b/sbin/fsck_ext2fs/setup.c @@ -1,4 +1,4 @@ -/* $NetBSD: setup.c,v 1.34 2016/08/15 18:57:06 jdolecek Exp $ */ +/* $NetBSD: setup.c,v 1.35 2016/08/15 19:13:24 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.34 2016/08/15 18:57:06 jdolecek Exp $"); +__RCSID("$NetBSD: setup.c,v 1.35 2016/08/15 19:13:24 jdolecek Exp $"); #endif #endif /* not lint */ @@ -78,6 +78,8 @@ __RCSID("$NetBSD: setup.c,v 1.34 2016/08/15 18:57:06 jdolecek Exp $"); #include #include +#include + #include "fsck.h" #include "extern.h" #include "fsutil.h" @@ -385,6 +387,21 @@ readsb(int listerr) sblock.e2fs.e2fs_features_compat, sblock.e2fs.e2fs_features_incompat, sblock.e2fs.e2fs_features_rocompat); + + if ((sblock.e2fs.e2fs_features_rocompat & ~EXT2F_ROCOMPAT_SUPP_FSCK)) { + char buf[512]; + + snprintb(buf, sizeof(buf), EXT2F_ROCOMPAT_BITS, + sblock.e2fs.e2fs_features_rocompat & ~EXT2F_ROCOMPAT_SUPP_FSCK); + printf("unsupported rocompat features: %s\n", buf); + } + if ((sblock.e2fs.e2fs_features_incompat & ~EXT2F_INCOMPAT_SUPP_FSCK)) { + char buf[512]; + + snprintb(buf, sizeof(buf), EXT2F_INCOMPAT_BITS, + sblock.e2fs.e2fs_features_incompat & ~EXT2F_INCOMPAT_SUPP_FSCK); + printf("unsupported incompat features: %s\n", buf); + } } badsb(listerr, "INCOMPATIBLE FEATURE BITS IN SUPER BLOCK"); return 0;