Subject: kern/3785: adosfs misses diagnostic for bad 'secondary' types
To: None <gnats-bugs@gnats.netbsd.org>
From: Michael van Elst <mlelstv@serpens.swb.de>
List: netbsd-bugs
Date: 06/24/1997 22:32:05
>Number:         3785
>Category:       kern
>Synopsis:       adosfs misses diagnostic for bad 'secondary' type
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    kern-bug-people (Kernel Bug People)
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Tue Jun 24 13:50:02 1997
>Last-Modified:
>Originator:     Michael van Elst
>Organization:
dis-
>Release:        NetBSD-current 20 Jun 1997
>Environment:
Amiga A3000/060, NetBSD-current, adosfs

System: NetBSD lemming 1.2G NetBSD 1.2G (LEMMING) #10: Sun Jun 22 21:26:36 MEST 1997 root@lemming:/usr/src/sys/arch/amiga/compile/LEMMING amiga


>Description:
	AmigaOS FastFileSystem meta data blocks contain two keys that
	identify a block. adosfs warns about blocks encountered
	that have an invalid primary key if compiled with DIAGNOSTIC
	but silently drops the error from invalid secondary keys.

	Also, the warning about an invalid primary doesn't show the
	bad key value encountered.

>How-To-Repeat:
	create an adosfs partition with a meta block with a bad
	secondary key and see nothing on a NetBSD system even when
	the kernel is compiled with DIAGNOSTIC.

>Fix:
	Modify adosfs/adutil.c
	113,114c113,114
	<               printf("adosfs: aget: bad primary type blk %ld\n",
	<                   bp->b_blkno / amp->secsperblk);
	---
	>               printf("adosfs: aget: bad primary type blk %ld (type
	= %d)\n",
	>                   bp->b_blkno / amp->secsperblk, adoswordn(bp,0));
	132a133,136
	> #ifdef DIAGNOSTIC
	>       printf("adosfs: aget: bad secondary type blk %ld (type =
	%d)\n",
	>           bp->b_blkno / amp->secsperblk,adoswordn(bp, amp->nwords
	- 1));
	> #endif

>Audit-Trail:
>Unformatted: