From 6e4615fb0f1bcc6b020699f50baa576c0b7db5b8 Mon Sep 17 00:00:00 2001 From: hannken Date: Tue, 13 Feb 2018 11:20:08 +0000 Subject: [PATCH] Treat an inode with "mode == 0" and "blocks != 0" as partially allocated and clear it as ffs_newvnode() tests for "blocks == 0". --- sbin/fsck_ffs/pass1.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/sbin/fsck_ffs/pass1.c b/sbin/fsck_ffs/pass1.c index 0c48f13fa52e..942b20475c82 100644 --- a/sbin/fsck_ffs/pass1.c +++ b/sbin/fsck_ffs/pass1.c @@ -1,4 +1,4 @@ -/* $NetBSD: pass1.c,v 1.57 2017/02/08 16:11:40 rin Exp $ */ +/* $NetBSD: pass1.c,v 1.58 2018/02/13 11:20:08 hannken Exp $ */ /* * Copyright (c) 1980, 1986, 1993 @@ -34,7 +34,7 @@ #if 0 static char sccsid[] = "@(#)pass1.c 8.6 (Berkeley) 4/28/95"; #else -__RCSID("$NetBSD: pass1.c,v 1.57 2017/02/08 16:11:40 rin Exp $"); +__RCSID("$NetBSD: pass1.c,v 1.58 2018/02/13 11:20:08 hannken Exp $"); #endif #endif /* not lint */ @@ -253,8 +253,9 @@ checkinode(ino_t inumber, struct inodesc *idesc) (memcmp(dp->dp1.di_db, ufs1_zino.di_db, UFS_NDADDR * sizeof(int32_t)) || memcmp(dp->dp1.di_ib, ufs1_zino.di_ib, - UFS_NIADDR * sizeof(int32_t)))) || - mode || size) { + UFS_NIADDR * sizeof(int32_t)))) + || + mode || size || DIP(dp, blocks)) { pfatal("PARTIALLY ALLOCATED INODE I=%llu", (unsigned long long)inumber); if (reply("CLEAR") == 1) {