summaryrefslogtreecommitdiffstats
path: root/sbin
diff options
context:
space:
mode:
authorjulian <julian@FreeBSD.org>2002-11-24 21:41:42 +0000
committerjulian <julian@FreeBSD.org>2002-11-24 21:41:42 +0000
commit1bb33a5f111f010cd897fc33b7db8bb2b4789bef (patch)
tree907b6acd7293ef4f76d719a05051f4ff9be0561f /sbin
parent7aa057786e697b9fd19d61994476c659b8cb514a (diff)
downloadFreeBSD-src-1bb33a5f111f010cd897fc33b7db8bb2b4789bef.zip
FreeBSD-src-1bb33a5f111f010cd897fc33b7db8bb2b4789bef.tar.gz
Fsck needs to check each CG's rotor values to ensure thay are not -ve.
It seems a common corruption to have them -ve (I've seen it several times) and if fsck doesn't fix it, it leads to a kernel pagefault. Reviewd by: kirk Submitted by: Eric Jacobs <eaja@erols.com> and me independently. MFC in: 2 days PR: bin/40967 Approved by: re
Diffstat (limited to 'sbin')
-rw-r--r--sbin/fsck_ffs/pass5.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sbin/fsck_ffs/pass5.c b/sbin/fsck_ffs/pass5.c
index c3f6c3d..074dbf8 100644
--- a/sbin/fsck_ffs/pass5.c
+++ b/sbin/fsck_ffs/pass5.c
@@ -184,15 +184,15 @@ pass5(void)
newcg->cg_cs.cs_nffree = 0;
newcg->cg_cs.cs_nbfree = 0;
newcg->cg_cs.cs_nifree = fs->fs_ipg;
- if (cg->cg_rotor < newcg->cg_ndblk)
+ if ((cg->cg_rotor >= 0) && (cg->cg_rotor < newcg->cg_ndblk))
newcg->cg_rotor = cg->cg_rotor;
else
newcg->cg_rotor = 0;
- if (cg->cg_frotor < newcg->cg_ndblk)
+ if ((cg->cg_frotor >= 0) && (cg->cg_frotor < newcg->cg_ndblk))
newcg->cg_frotor = cg->cg_frotor;
else
newcg->cg_frotor = 0;
- if (cg->cg_irotor < fs->fs_ipg)
+ if ((cg->cg_irotor >= 0) && (cg->cg_irotor < fs->fs_ipg))
newcg->cg_irotor = cg->cg_irotor;
else
newcg->cg_irotor = 0;
OpenPOWER on IntegriCloud