From owner-freebsd-amd64@FreeBSD.ORG Sat Nov 5 04:30:22 2005 Return-Path: X-Original-To: freebsd-amd64@hub.freebsd.org Delivered-To: freebsd-amd64@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0B05416A41F for ; Sat, 5 Nov 2005 04:30:22 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id AB9C643D45 for ; Sat, 5 Nov 2005 04:30:21 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.3/8.13.3) with ESMTP id jA54ULoL084214 for ; Sat, 5 Nov 2005 04:30:21 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.3/8.13.1/Submit) id jA54UL9c084208; Sat, 5 Nov 2005 04:30:21 GMT (envelope-from gnats) Date: Sat, 5 Nov 2005 04:30:21 GMT Message-Id: <200511050430.jA54UL9c084208@freefall.freebsd.org> To: freebsd-amd64@FreeBSD.org From: "Devon O'Dell" Cc: Subject: Re: amd64/88249: getdents syscall fails for devfs on amd64 linuxalator X-BeenThere: freebsd-amd64@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Devon O'Dell List-Id: Porting FreeBSD to the AMD64 platform List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 05 Nov 2005 04:30:22 -0000 The following reply was made to PR amd64/88249; it has been noted by GNATS. From: "Devon O'Dell" To: freebsd-gnats-submit@FreeBSD.org, "Arno J. Klaassen" Cc: Subject: Re: amd64/88249: getdents syscall fails for devfs on amd64 linuxalator Date: Fri, 4 Nov 2005 20:27:40 -0800 --pf9I7BMVVzbSWLtt Content-Type: text/plain; charset=us-ascii Content-Disposition: inline I tested this issue and had the same result in FreeBSD 7-CURRENT/amd64. The attached patch fixes the issue, but I'm not sure if it is the correct solution. I'm sort of unfamiliar with the codepath leading up to the fix. Can someone please look at this? --Devon example: > /compat/linux/bin/bash bash-2.05b$ tty /dev/ttyp3 bash-2.05b$ ls /dev acd0 ata dsp0.1 io net4 stderr ttyv1 ttyvd acd0t01 audio0.0 dspW0.0 kbd0 network stdin ttyv2 ttyve acpi audio0.1 dspW0.1 klog nfs4 stdout ttyv3 ttyvf ad4 console dspr0.1 kmem nfslock sysmouse ttyv4 ukbd0 ad4s1 consolectl dumpdev log null ttyd0 ttyv5 ums0 ad4s1a ctty fd mdctl pci ttyd0.init ttyv6 urandom ad4s1b cuad0 fido mem ptyp0 ttyd0.lock ttyv7 usb ad4s1c cuad0.init fw0 mixer0 ptyp1 ttyp0 ttyv8 usb0 ad4s1d cuad0.lock fw0.0 net ptyp2 ttyp1 ttyv9 usb1 ad4s1e devctl fwmem0 net1 ptyp3 ttyp2 ttyva xpt0 ad4s1f devstat fwmem0.0 net2 random ttyp3 ttyvb zero ad4s2 dsp0.0 geom.ctl net3 sndstat ttyv0 ttyvc bash-2.05b$ uname -a Linux skik.dtrace.internal.sitetronics.com 2.4.2 FreeBSD 7.0-CURRENT #0: Fri Nov 4 20:11:34 PST 2005 i686 i686 i386 GNU/Linux --pf9I7BMVVzbSWLtt Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="linux_getdents_panic.patch" --- sys/kern/vfs_subr.c Mon Oct 31 07:41:25 2005 +++ sys/kern/vfs_subr.c Fri Nov 4 20:22:47 2005 @@ -3873,7 +3873,7 @@ } return (error); } - if (ap->a_ncookies == NULL) + if (ap->a_ncookies == NULL || *ap->a_cookies == NULL) return (0); *ap->a_cookies = realloc(*ap->a_cookies, (*ap->a_ncookies + 1) * sizeof(u_long), M_TEMP, M_WAITOK | M_ZERO); --pf9I7BMVVzbSWLtt--