The following reply was made to PR system/6421; it has been noted by GNATS.
From: Otto Moerbeek <[email protected]> To: Benny L?fgren <[email protected]> Cc: [email protected] Subject: Re: system/6421: fsck_ffs core dumps when checking very large (>4TB) filesystems Date: Thu, 8 Jul 2010 09:19:47 +0200 Hi, The diff you sent me in private had tabs mangled so it did not apply. But here's my version. For pass1.c, it's not needed to change the type of c, since fs_ncg is an int. I did not take the pass1b.c chunk (fs_ncg and fs_ipg are both int, so no need to change c or i). For pass5.c, I took an equivalent fix from freebsd. I also changed the other chunk to make the consistent with the rest of the code. BTW, I did not encouter this bug with my testing, since I create large filesystems with bigger fragments and blocks. In my experience, filesystems with that many blocks take so long to check it makes them unusable. Please test this diff. -Otto Index: pass1.c =================================================================== RCS file: /cvs/src/sbin/fsck_ffs/pass1.c,v retrieving revision 1.32 diff -u -p -r1.32 pass1.c --- pass1.c 27 Oct 2009 23:59:32 -0000 1.32 +++ pass1.c 8 Jul 2010 06:54:57 -0000 @@ -63,7 +63,8 @@ pass1(void) { struct inodesc idesc; ino_t inumber, inosused; - int c, i, cgd; + int c; + daddr64_t i, cgd; /* * Set file system reserved blocks in used block map. Index: pass5.c =================================================================== RCS file: /cvs/src/sbin/fsck_ffs/pass5.c,v retrieving revision 1.38 diff -u -p -r1.38 pass5.c --- pass5.c 27 Oct 2009 23:59:32 -0000 1.38 +++ pass5.c 8 Jul 2010 07:09:24 -0000 @@ -170,9 +170,9 @@ pass5(void) idesc[i].id_fix = FIX; } memset(&cstotal, 0, sizeof(struct csum_total)); - j = blknum(fs, fs->fs_size + fs->fs_frag - 1); - for (i = fs->fs_size; i < j; i++) - setbmap(i); + dmax = blknum(fs, fs->fs_size + fs->fs_frag - 1); + for (d = fs->fs_size; d < dmax; d++) + setbmap(d); info_cg = 0; info_maxcg = fs->fs_ncg; info_fn = pass5_info;
