From owner-freebsd-bugs@FreeBSD.ORG Wed Sep 24 19:30:05 2008 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4CA141065674 for ; Wed, 24 Sep 2008 19:30:05 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 3801D8FC08 for ; Wed, 24 Sep 2008 19:30:05 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.2/8.14.2) with ESMTP id m8OJU463048013 for ; Wed, 24 Sep 2008 19:30:04 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.2/8.14.1/Submit) id m8OJU4AY048012; Wed, 24 Sep 2008 19:30:04 GMT (envelope-from gnats) Date: Wed, 24 Sep 2008 19:30:04 GMT Message-Id: <200809241930.m8OJU4AY048012@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org From: Eygene Ryabinkin Cc: Subject: Re: bin/127605: [patch] properly initialise ccb_h.path_id in cam_open_btl (lib/libcam) X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Eygene Ryabinkin List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Sep 2008 19:30:05 -0000 The following reply was made to PR kern/127605; it has been noted by GNATS. From: Eygene Ryabinkin To: bug-followup@freebsd.org Cc: Subject: Re: bin/127605: [patch] properly initialise ccb_h.path_id in cam_open_btl (lib/libcam) Date: Wed, 24 Sep 2008 23:26:12 +0400 --ZPt4rx8FFjLCG7dd Content-Type: text/plain; charset=koi8-r Content-Disposition: inline Content-Transfer-Encoding: quoted-printable I got why the mentioned error shows up on my machine, but it seems to be rare on the others: my particular host has no SCSI bus #0, ATAPI CAM CD-ROM is at the bus #1. Two other machines I had tried EDT members enumeration at, have bus #0. And since 'union cbb' is zeroed before use, the path_id is effectively set to 0. And the code in sys/cam/cam_xpt.c that handles XPT_DEV_MATCH just checks if the passed bus exists, but, if I am not mistaken, does not use the obtained 'bus' argument in any specific way. Sooo, it seems to me that it is a bit redundant to set the fields target_id and target_lun, but it is wise to initialize path_id to CAM_XPT_PATH_ID, since this bus is always initialized within xpt_init() and if this bus is not created, xpt_init() bails out with EINVAL, thus refusing to create the xpt instance. --=20 Eygene _ ___ _.--. # \`.|\..----...-'` `-._.-'_.-'` # Remember that it is hard / ' ` , __.--' # to read the on-line manual =20 )/' _/ \ `-_, / # while single-stepping the kernel. `-'" `"\_ ,_.-;_.-\_ ', fsc/as # _.-'_./ {_.' ; / # -- FreeBSD Developers handbook=20 {_.-``-' {_/ # --ZPt4rx8FFjLCG7dd Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.9 (FreeBSD) iEYEARECAAYFAkjalFQACgkQthUKNsbL7YhSUQCdH9SzhOSjMTfWUQjPa0UvJmg4 39kAoKNoIRTtkhMxJ8WJgULLkGqqmIVw =taPn -----END PGP SIGNATURE----- --ZPt4rx8FFjLCG7dd--