divorce list of features supported by fsck_ext2fs from the kernel;

while kernel might support e.g. extents, extra_isize or dir_nlink,
fsck could actually have no idea about the features
This commit is contained in:
jdolecek 2016-08-15 18:42:15 +00:00
parent a9097f8578
commit d2d8cddee2
2 changed files with 16 additions and 5 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: fsck.h,v 1.15 2009/10/19 18:41:08 bouyer Exp $ */
/* $NetBSD: fsck.h,v 1.16 2016/08/15 18:42:15 jdolecek Exp $ */
/*
* Copyright (c) 1980, 1986, 1993
@ -230,6 +230,17 @@ struct ext2fs_dinode zino;
#define ALTERED 0x08
#define FOUND 0x10
/*
* Kernel support for features doesn't imply fsck support
*/
#define EXT2F_COMPAT_SUPP_FSCK 0x00
#define EXT2F_ROCOMPAT_SUPP_FSCK (EXT2F_ROCOMPAT_SPARSESUPER \
| EXT2F_ROCOMPAT_LARGEFILE \
| EXT2F_ROCOMPAT_HUGE_FILE \
)
#define EXT2F_INCOMPAT_SUPP_FSCK (EXT2F_INCOMPAT_FTYPE \
)
struct ext2fs_dinode *ginode(ino_t);
struct inoinfo *getinoinfo(ino_t);
void getblk(struct bufarea *, daddr_t, long);

View File

@ -1,4 +1,4 @@
/* $NetBSD: setup.c,v 1.32 2014/12/04 01:41:37 christos Exp $ */
/* $NetBSD: setup.c,v 1.33 2016/08/15 18:42:15 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.32 2014/12/04 01:41:37 christos Exp $");
__RCSID("$NetBSD: setup.c,v 1.33 2016/08/15 18:42:15 jdolecek Exp $");
#endif
#endif /* not lint */
@ -377,8 +377,8 @@ readsb(int listerr)
asblk.b_un.b_fs->e2fs_features_rocompat |=
sblk.b_un.b_fs->e2fs_features_rocompat & EXT2F_ROCOMPAT_LARGEFILE;
if (sblock.e2fs.e2fs_rev > E2FS_REV0 &&
((sblock.e2fs.e2fs_features_incompat & ~EXT2F_INCOMPAT_SUPP) ||
(sblock.e2fs.e2fs_features_rocompat & ~EXT2F_ROCOMPAT_SUPP))) {
((sblock.e2fs.e2fs_features_incompat & ~EXT2F_INCOMPAT_SUPP_FSCK) ||
(sblock.e2fs.e2fs_features_rocompat & ~EXT2F_ROCOMPAT_SUPP_FSCK))) {
if (debug) {
printf("compat 0x%08x, incompat 0x%08x, compat_ro "
"0x%08x\n",