ports/63117: fsck_ext2fs does not work on 5.x

Tim Robbins tim at robbins.dropbear.id.au
Fri Feb 20 11:20:07 UTC 2004


>Number:         63117
>Category:       ports
>Synopsis:       fsck_ext2fs does not work on 5.x
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Feb 20 03:20:06 PST 2004
>Closed-Date:
>Last-Modified:
>Originator:     Tim Robbins
>Release:        FreeBSD 5.2-tjr i386
>Organization:
The FreeBSD Project
>Environment:
System: FreeBSD cat.robbins.dropbear.id.au 5.2-tjr FreeBSD 5.2-tjr #1: Fri Jan 23 02:11:08 EST 2004 tim at cat.robbins.dropbear.id.au:/usr/obj/home/tim/p4/src/sys/CAT i386

>Description:

sysutils/fsck_ext2fs does not work on 5.x; it always reports that the
superblock's magic number is wrong.

>How-To-Repeat:

# fsck_ext2fs /dev/ad1s1
** /dev/ad1s1
BAD SUPER BLOCK: MAGIC NUMBER WRONG
ioctl (GCINFO): Inappropriate ioctl for device
/dev/ad1s1: can't read disk label

Note that the "Inappropriate ioctl for device" error is not directly
related to the magic number error; fsck_ext2fs is looking for alternate
superblocks.

>Fix:

BBSIZE (the size of the boot block) was moved into sys/disklabel.h
in 5.x. fsck_ext2fs #includes disklabel.h after ext2fs.h, so its local
definition in ext2fs.h gets overridden by the incorrect one in
disklabel.h. The fix is to #include disklabel.h first, then #undef
BBSIZE, then include the ext2fs-specific headers.

There is another bug that stops fsck_ext2fs working on 5.x, too:
it uses daddr_t on-disk, but daddr_t is 64 bits wide on 5.x instead
of the 32 bits wide that this code expects.
>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the freebsd-ports-bugs mailing list