Subject: port-sparc64/20980: LFS root on sparc64 problems - Bad file descriptor
To: None <gnats-bugs@gnats.netbsd.org>
From: None <abs@netbsd.org>
List: netbsd-bugs
Date: 04/02/2003 16:17:44
>Number:         20980
>Category:       port-sparc64
>Synopsis:       LFS root on sparc64 problems - Bad file descriptor
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    port-sparc64-maintainer
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Apr 02 07:18:01 PST 2003
>Closed-Date:
>Last-Modified:
>Originator:     Joe Root
>Release:        NetBSD 1.6Q - 2003/3/31
>Organization:
Occasional
>Environment:
System: NetBSD proton.mono.org 1.6Q NetBSD 1.6Q (_ULTRA1_) #1: Mon Mar 31 13:16:50 UTC 2003 abs@gta.i.purplei.com:/var/obj/src/_ULTRA1_ sparc64
Architecture: sparc64
Machine: sparc64
>Description:
	When booting a sparc64 kernel with LFS on root (the bootblocks
	and kernel need to be loaded from an FFS partition and the
	root filesystem specified with 'boot -a') the root partition
	device in /dev cannot be accessed - it gives 'Bad file descriptor'.

	Netbooting the bootblocks and kernel and specifying the
	root partition as sd0e results in fsck panicing with:

            Stopped in pid 9.1 (fsck) at sys_statfs+0x54: ldx [%i0 + 0 x10], %o0
            db> trace
            syscall(1133bed0, 9d, 0, 112f1300, 4052fb78, 4052fb74) at
            syscall+0x344
            syscall_setup(ffffffffffffdc6d, ffffffffffffcbf0, 212000, 406e0a80,
            0, 0) at syscall_setup+0xe8

        Netbooting with nfs root and mounting sd0e somewhere else works fine.

>How-To-Repeat:
	eg: create LFS sd0e and boot it as root filesystem
            # fsck
            /dev/sd0e (Bad file descriptor)Can't stat /dev/sd0e
            /dev/sd0e (Bad file descriptor)Can't stat /dev/sd0e
            Can't stat /dev/sd0e: Bad file descriptor
            ** /dev/rsd0a
            ** File system is clean; not checking
            # ls -l /dev/sd0*
            ls: /dev/sd0e: Bad file descriptor
            brw-r-----  1 root  operator  7, 0 Mar 31 11:44 /dev/sd0a
            brw-r-----  1 root  operator  7, 1 Mar 31 11:44 /dev/sd0b
            brw-r-----  1 root  operator  7, 2 Mar 31 11:44 /dev/sd0c
            brw-r-----  1 root  operator  7, 3 Mar 31 11:44 /dev/sd0d
            brw-r-----  1 root  operator  7, 5 Mar 31 11:44 /dev/sd0f
            brw-r-----  1 root  operator  7, 6 Mar 31 11:44 /dev/sd0g
            brw-r-----  1 root  operator  7, 7 Mar 31 11:44 /dev/sd0h
            #

>Fix:
	None known.
>Release-Note:
>Audit-Trail:
>Unformatted: