Subject: kern/5121: sizeof(struct lfs) != 512 causes newlfs(8) to fail
To: None <gnats-bugs@gnats.netbsd.org>
From: NAKAJIMA Yoshihiro <nakayosh@kcn.or.jp>
List: netbsd-bugs
Date: 03/07/1998 03:48:24
>Number:         5121
>Category:       kern
>Synopsis:       sizeof(struct lfs) != 512 causes newlfs(8) to fail
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    kern-bug-people (Kernel Bug People)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Mar  6 10:50:01 1998
>Last-Modified:
>Originator:     NAKAJIMA Yoshihiro
>Organization:
>Release:        NetBSD-current 98/03/03
>Environment:
System: NetBSD asura 1.3E NetBSD 1.3E (ASURA) #2: Fri Mar 6 22:18:48 JST 1998 nakayosh@asura:/usr/src/sys/arch/i386/compile/ASURA i386


>Description:
	In recent change (1.2D -> 1.2E), the size of `struct lfs' in
	ufs/lfs/lfs.h is changed from 512 bytes to 524 bytes in i386.

	newlfs(8) tries to write non 512byte data to disk, and it fails.

>How-To-Repeat:
	newlfs -L some_disk

>Fix:
	I don't know the right solution.

	there are two pointers in `struct lfs'. For i386, change of
	`lfs_pad[40]' -> `lfs_pad[37]' works fine. But 64bit pointer
	machine needs another pad size.

	In addition, current mechanism isn't adapted to non-512byte
	block media.
>Audit-Trail:
>Unformatted: