bin/127605: [patch] properly initialise ccb_h.path_id in cam_open_btl (lib/libcam)

Eygene Ryabinkin rea-fbsd at codelabs.ru
Wed Sep 24 19:30:05 UTC 2008


The following reply was made to PR kern/127605; it has been noted by GNATS.

From: Eygene Ryabinkin <rea-fbsd at codelabs.ru>
To: bug-followup at 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--


More information about the freebsd-bugs mailing list