| Summary: | can't compile when softupdates + debug. | ||
|---|---|---|---|
| Product: | Base System | Reporter: | spam <spam> |
| Component: | kern | Assignee: | Sheldon Hearn <sheldonh> |
| Status: | Closed FIXED | ||
| Severity: | Affects Only Me | ||
| Priority: | Normal | ||
| Version: | Unspecified | ||
| Hardware: | Any | ||
| OS: | Any | ||
|
Description
spam
1999-08-22 04:20:01 UTC
It looks like the problem was introduced in rev 1.28 of ffs_alloc.c .
I think the patch below is the correct fix to this problem. Please try
it with
options DIAGNOSTIC
instead of
options DEBUG
in your kernel config file.
Your feedback would be greatly appreciated.
Thanks,
Sheldon.
Index: ffs_alloc.c
===================================================================
RCS file: /home/ncvs/src/sys/ufs/ffs/ffs_alloc.c,v
retrieving revision 1.58
diff -u -d -r1.58 ffs_alloc.c
--- ffs_alloc.c 1999/05/12 22:32:07 1.58
+++ ffs_alloc.c 1999/08/23 14:58:03
@@ -343,7 +343,7 @@
static int doreallocblks = 1;
SYSCTL_INT(_vfs_ffs, FFS_REALLOCBLKS, doreallocblks, CTLFLAG_RW, &doreallocblks, 0, "");
-#ifdef DEBUG
+#ifdef DIAGNOSTIC
static volatile int prtrealloc = 0;
#endif
@@ -447,7 +447,7 @@
* block pointers in the inode and indirect blocks associated
* with the file.
*/
-#ifdef DEBUG
+#ifdef DIAGNOSTIC
if (prtrealloc)
printf("realloc: ino %d, lbns %d-%d\n\told:", ip->i_number,
start_lbn, end_lbn);
@@ -465,7 +465,7 @@
if (dbtofsb(fs, buflist->bs_children[i]->b_blkno) != *bap)
panic("ffs_reallocblks: alloc mismatch");
#endif
-#ifdef DEBUG
+#ifdef DIAGNOSTIC
if (prtrealloc)
printf(" %d,", *bap);
#endif
@@ -514,7 +514,7 @@
/*
* Last, free the old blocks and assign the new blocks to the buffers.
*/
-#ifdef DEBUG
+#ifdef DIAGNOSTIC
if (prtrealloc)
printf("\n\tnew:");
#endif
@@ -524,7 +524,7 @@
dbtofsb(fs, buflist->bs_children[i]->b_blkno),
fs->fs_bsize);
buflist->bs_children[i]->b_blkno = fsbtodb(fs, blkno);
-#ifdef DEBUG
+#ifdef DIAGNOSTIC
if (!ffs_checkblk(ip,
dbtofsb(fs, buflist->bs_children[i]->b_blkno), fs->fs_bsize))
panic("ffs_reallocblks: unallocated block 3");
@@ -532,7 +532,7 @@
printf(" %d,", blkno);
#endif
}
-#ifdef DEBUG
+#ifdef DIAGNOSTIC
if (prtrealloc) {
prtrealloc--;
printf("\n");
Responsible Changed From-To: freebsd-bugs->sheldonh I'll take this one. If it gets hairy, I'll back off. :-) On Mon, 23 Aug 1999 17:07:37 +0200, Sheldon Hearn wrote:
> options DIAGNOSTIC
>
> instead of
>
> options DEBUG
Sorry, got muddled. You can have both in your kernel config if you want.
Ciao,
Sheldon.
or some odd combination of the two. thanx for the prompt reply.
On Mon, 23 Aug 1999, Sheldon Hearn wrote:
>
> It looks like the problem was introduced in rev 1.28 of ffs_alloc.c .
> I think the patch below is the correct fix to this problem. Please try
> it with
>
> options DIAGNOSTIC
>
> instead of
>
> options DEBUG
>
> in your kernel config file.
>
> Your feedback would be greatly appreciated.
>
> Thanks,
> Sheldon.
>
> Index: ffs_alloc.c
> ===================================================================
> RCS file: /home/ncvs/src/sys/ufs/ffs/ffs_alloc.c,v
> retrieving revision 1.58
> diff -u -d -r1.58 ffs_alloc.c
> --- ffs_alloc.c 1999/05/12 22:32:07 1.58
> +++ ffs_alloc.c 1999/08/23 14:58:03
> @@ -343,7 +343,7 @@
> static int doreallocblks = 1;
> SYSCTL_INT(_vfs_ffs, FFS_REALLOCBLKS, doreallocblks, CTLFLAG_RW, &doreallocblks, 0, "");
>
> -#ifdef DEBUG
> +#ifdef DIAGNOSTIC
> static volatile int prtrealloc = 0;
> #endif
>
> @@ -447,7 +447,7 @@
> * block pointers in the inode and indirect blocks associated
> * with the file.
> */
> -#ifdef DEBUG
> +#ifdef DIAGNOSTIC
> if (prtrealloc)
> printf("realloc: ino %d, lbns %d-%d\n\told:", ip->i_number,
> start_lbn, end_lbn);
> @@ -465,7 +465,7 @@
> if (dbtofsb(fs, buflist->bs_children[i]->b_blkno) != *bap)
> panic("ffs_reallocblks: alloc mismatch");
> #endif
> -#ifdef DEBUG
> +#ifdef DIAGNOSTIC
> if (prtrealloc)
> printf(" %d,", *bap);
> #endif
> @@ -514,7 +514,7 @@
> /*
> * Last, free the old blocks and assign the new blocks to the buffers.
> */
> -#ifdef DEBUG
> +#ifdef DIAGNOSTIC
> if (prtrealloc)
> printf("\n\tnew:");
> #endif
> @@ -524,7 +524,7 @@
> dbtofsb(fs, buflist->bs_children[i]->b_blkno),
> fs->fs_bsize);
> buflist->bs_children[i]->b_blkno = fsbtodb(fs, blkno);
> -#ifdef DEBUG
> +#ifdef DIAGNOSTIC
> if (!ffs_checkblk(ip,
> dbtofsb(fs, buflist->bs_children[i]->b_blkno), fs->fs_bsize))
> panic("ffs_reallocblks: unallocated block 3");
> @@ -532,7 +532,7 @@
> printf(" %d,", blkno);
> #endif
> }
> -#ifdef DEBUG
> +#ifdef DIAGNOSTIC
> if (prtrealloc) {
> prtrealloc--;
> printf("\n");
>
On Tue, 24 Aug 1999 01:46:06 +1000, Bruce Evans wrote: > No, prtrealloc is for debugging, not for diagnostics. I assumed too much. It's recurring theme that becomes less funny each time it comes around. > The ifdefs fo ffs_chkblk() are wrong. *nod* Once you pointed out the need for prtrealloc to be conditional on DEBUG, the rest kinda became obvious. Ciao, Sheldon. Index: ffs_alloc.c =================================================================== RCS file: /home/ncvs/src/sys/ufs/ffs/ffs_alloc.c,v retrieving revision 1.58 diff -u -d -r1.58 ffs_alloc.c --- ffs_alloc.c 1999/05/12 22:32:07 1.58 +++ ffs_alloc.c 1999/08/23 15:50:54 @@ -524,10 +524,12 @@ dbtofsb(fs, buflist->bs_children[i]->b_blkno), fs->fs_bsize); buflist->bs_children[i]->b_blkno = fsbtodb(fs, blkno); -#ifdef DEBUG +#ifdef DIAGNOSTIC if (!ffs_checkblk(ip, dbtofsb(fs, buflist->bs_children[i]->b_blkno), fs->fs_bsize)) panic("ffs_reallocblks: unallocated block 3"); +#endif +#ifdef DEBUG if (prtrealloc) printf(" %d,", blkno); #endif State Changed From-To: open->analyzed Fixed in CURRENT in rev 1.60 . MFC to follow. State Changed From-To: analyzed->suspended I'm told that suspended is the correct state for issues awaiting an MFC. State Changed From-To: suspended->closed Merged from CURRENT in rev 1.56.2.2. |