svn commit: r298551 - head/sbin/fsck_ffs

Pedro F. Giffuni pfg at FreeBSD.org
Sun Apr 24 20:31:23 UTC 2016


Author: pfg
Date: Sun Apr 24 20:31:22 2016
New Revision: 298551
URL: https://svnweb.freebsd.org/changeset/base/298551

Log:
  fsck_ffs: Adopt some type safety for the journalling checks.
  
  fs_ncg is of type uint32, and we were indexing it with an int.
  Fixed this using an unsigned type and adopt some other unsigned
  indexes to remind us when we are dealing with unsigned numbers.
  
  Reviewed by:	mckusick
  MFC after:	5 days

Modified:
  head/sbin/fsck_ffs/suj.c

Modified: head/sbin/fsck_ffs/suj.c
==============================================================================
--- head/sbin/fsck_ffs/suj.c	Sun Apr 24 19:25:11 2016	(r298550)
+++ head/sbin/fsck_ffs/suj.c	Sun Apr 24 20:31:22 2016	(r298551)
@@ -217,7 +217,7 @@ static void
 closedisk(const char *devnam)
 {
 	struct csum *cgsum;
-	int i;
+	u_int i;
 
 	/*
 	 * Recompute the fs summary info from correct cs summaries.
@@ -2252,7 +2252,7 @@ suj_build(void)
 	struct suj_seg *seg;
 	union jrec *rec;
 	int off;
-	int i;
+	u_int i;
 
 	TAILQ_FOREACH(seg, &allsegs, ss_next) {
 		if (debug)
@@ -2540,10 +2540,10 @@ suj_read(void)
 	struct jsegrec *rec;
 	ufs2_daddr_t blk;
 	int readsize;
-	int blocks;
+	u_int blocks;
 	int recsize;
 	int size;
-	int i;
+	u_int i;
 
 	/*
 	 * Read records until we exhaust the journal space.  If we find


More information about the svn-src-head mailing list