Subject: port-macppc/22291: kernel panic when reading from os x ufs formatted disk
To: None <gnats-bugs@gnats.NetBSD.org>
From: None <let@www.netbsd.org, A@www.netbsd.org, =@www.netbsd.org,>
List: netbsd-bugs
Date: 07/28/2003 17:38:06
>Number:         22291
>Category:       port-macppc
>Synopsis:       kernel panic when reading from os x ufs formatted disk
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    port-macppc-maintainer
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Jul 28 17:39:00 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator:     Christopher Holloway
>Release:        1.6.1
>Organization:
>Environment:
NetBSD pai 1.6.1_STABLE NetBSD 1.6.1_STABLE (PAI) #8: Sun Jul 27 11:07:10 BST 2003     root@pai:/usr/src/sys/arch/macppc/compile/PAI macppc
>Description:
I have two usb disks (a maxtor 5000xt and linksys 128MB pen drive) which have both been formatted in OS X as UFS. NetBSD can mount them both, but when data on the disks is read, NetBSD has a kernel panic. Logs:

Jul 27 23:04:07 pai /netbsd: umass0 at uhub1 port 1 configuration 1 interface 0uhidev0 at uhub0 port 1 configuration 1 interface 0
Jul 27 23:04:07 pai /netbsd: umass0: Linksys Instant USB Disk, rev 1.10/1.00, addr 2
Jul 27 23:04:07 pai /netbsd: umass0: using SCSI over Bulk-Only
Jul 27 23:04:07 pai /netbsd: scsibus0 at umass0: 2 targets, 1 luns per target
Jul 27 23:04:07 pai /netbsd: scsibus0: waiting 2 seconds for devices to settle...
Jul 27 23:04:07 pai /netbsd: sd0 at scsibus0 target 1 lun 0: <Linksys, Instant USB Disk, 1.06> SCSI0 0/direct removable
Jul 27 23:04:07 pai /netbsd: sd0: mode sense (5) returned nonsense; using fictitious geometry
Jul 27 23:04:07 pai /netbsd: sd0: 125 MB, 125 cyl, 64 head, 32 sec, 512 bytes/sect x 256000 sectors
[disk is mounted here]
Jul 27 23:05:12 pai /netbsd: sd0: mode sense (5) returned nonsense; using fictitious geometry
Jul 27 23:05:12 pai /netbsd: /dev/sd0a: file system not clean (fs_clean=4); please fsck(8)
Jul 27 23:05:12 pai /netbsd: /dev/sd0a: lost blocks 0 files 0
Jul 27 23:10:54 pai /netbsd: First bad, reclen=23c, DIRSIZ=24, namlen=12, flags=1000 entryoffsetinblock=452
Jul 27 23:10:54 pai /netbsd: /mnt: bad dir ino 3968 at offset 452: mangled entry
Jul 27 23:10:54 pai /netbsd: panic: bad dir
Jul 27 23:10:54 pai /netbsd: syncing disks... panic: lockmgr: locking against myself
Jul 27 23:10:54 pai /netbsd: dumpsys: TBD
Jul 27 23:10:55 pai /netbsd: rebooting

(the disk was 'unclean' because of a previous panic of the same nature, where the disk was mounted clean, fsck does not work on the disk in netbsd)

I mounted the disk, changed directory, and ran the 'file' command on its contents, then the panic occured.
>How-To-Repeat:
The disk was formatted as UFS, and the data put on the disk both by OS X. The disk was then mounted in netbsd, using the command 'mount -t ufs /dev/sd0a /mnt', and to get it to panic I changed directory, and ran file on its contents, which was about 30-40MB of data, the panic then occured. I can provide a disk image if needed. This has happened both with and without the 'APPLE_UFS' option in my kernel. I am using OS X 10.2.6.
>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted: