On a HP server with a "Smart HBA H241" SAS controller with an external D6020 disk enclosure it doesn't seem to display the 35 disks installed (and in use as a big ZFS zpool): # cciss_vol_status -V /dev/ciss1 Controller: Smart HBA H241 Board ID: 0x21c8103c Logical drives: 0 Running firmware: 6.60 ROM firmware: 6.60 Physical drives: 0 /dev/ciss1: (Smart HBA H241) Enclosure D6020 (S/N: 7CE823P1HE) on Bus 2, Physical Port 1E status: OK. /dev/ciss1(Smart HBA H241:0): Non-Volatile Cache status: Cache configured: No # camcontrol devlist|egrep scbus4|wc -l 35 Excerpt from dmesg: da6 at ciss1 bus 32 scbus4 target 16 lun 0 da6: <HP MB010000JWAYK HPD5> Fixed Direct Access SPC-4 SCSI device da6: Serial Number JEJ3UBPN da6: 135.168MB/s transfers da6: Command Queueing enabled da6: 9537536MB (2441609216 4096 byte sectors) da7 at ciss1 bus 32 scbus4 target 17 lun 0 da7: <HP MB010000JWAYK HPD5> Fixed Direct Access SPC-4 SCSI device da7: Serial Number JEJ414TN da7: 135.168MB/s transfers da7: Command Queueing enabled da7: 9537536MB (2441609216 4096 byte sectors) Whereas on FreeBSD 11.3-RELEASE-p5, it correctly displays the connected drives (different server, but similar hardware): # cciss_vol_status -V /dev/ciss1 Controller: Smart HBA H241 Board ID: 0x21c8103c Logical drives: 0 Running firmware: 6.60 ROM firmware: 6.60 Physical drives: 21 connector 1E box 1 bay 22 HP MB010000JWAYK JEHJY9WN HPD5 OK connector 1E box 1 bay 23 HP MB010000JWAYK JEHJS9RN HPD5 OK connector 1E box 1 bay 24 HP MB010000JWAYK JEHHWKUN HPD5 OK connector 1E box 1 bay 25 HP MB010000JWAYK JEHJR20N HPD5 OK connector 1E box 1 bay 26 HP MB010000JWAYK JEHJ7DSN HPD5 OK connector 1E box 1 bay 27 HP MB010000JWAYK JEHHK0BN HPD5 OK connector 1E box 1 bay 28 HP MB010000JWAYK JEHJUD1N HPD5 OK connector 1E box 1 bay 29 HP MB010000JWAYK JEHJ0NLN HPD5 OK connector 1E box 1 bay 30 HP MB010000JWAYK JEHJ7VEN HPD5 OK connector 1E box 1 bay 31 HP MB010000JWAYK JEHHZ0VN HPD5 OK connector 1E box 1 bay 32 HP MB010000JWAYK JEHJ95KN HPD5 OK connector 1E box 1 bay 33 HP MB010000JWAYK JEHJ85EN HPD5 OK connector 1E box 1 bay 34 HP MB010000JWAYK JEHJ94YN HPD5 OK connector 1E box 1 bay 35 HP MB010000JWAYK JEHJ7DNN HPD5 OK connector 2E box 1 bay 29 HP MB010000JWAYK JEHG8E8N HPD5 OK connector 2E box 1 bay 30 HP MB010000JWAYK JEJ3A58N HPD5 OK connector 2E box 1 bay 31 HP MB010000JWAYK JEJ3NLAN HPD5 OK connector 2E box 1 bay 32 HP MB010000JWAYK JEJ4347N HPD5 OK connector 2E box 1 bay 33 HP MB010000JWAYK JEJ433NN HPD5 OK connector 2E box 1 bay 34 HP MB010000JWAYK JEHK031N HPD5 OK connector 2E box 1 bay 35 HP MB010000JWAYK JEHJEBEN HPD5 OK /dev/ciss1: (Smart HBA H241) Enclosure D6020 (S/N: 7CE814P34L) on Bus 2, Physical Port 1E status: OK. /dev/ciss1: (Smart HBA H241) Enclosure D6020 (S/N: 7CE814P34L) on Bus 3, Physical Port 2E status: OK. /dev/ciss1(Smart HBA H241:0): Non-Volatile Cache status: Cache configured: No
I have approved the patch provided in the other report: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=246357
Actually I don't think the other patch fixes this particular issue (that not all drives are printed). This is probably due to another issue where it doesn't correctly enumerate all drives if there are "gaps" in the list (like a drive gone bad). It stops at the first "missing" drive. I'll have a look at patching cciss_vol_status for this problem too. It shouldn't be impossible since the kernel driver does detect them correctly. (Atleast after some other bugs in the ciss driver has been fixed - it fails to detect more all drives if you have more than 48 drives per controller. But I have a patch and diff that solves that too - https://reviews.freebsd.org/D25155).
Created attachment 247922 [details] Patch to solve numerous issues in cciss_vol_status This patch solves a number of issues, and cleans up formatting of the output a little bit. 1. Fixes a number of bitwise comparisions that uses "&&" but really should be using "&". 2. Fixes a buffer overrun where the code writes to byte[41] (ie 42) in a 41 byte buffer... 3. Solves the "missing disks" problem - it seems the CISS HBA puts any disks with 4K native sector sizes in the "non-disk" list, even though they work perfectly fine with FreeBSD (when the controller is used as an HBA - they won't work when used as a RAID controller). 4. Adds a "-D" option which prints a little bit more info than "-V".
(The attachment is intended to replace the files/patch-cciss_vol_status.c file in the port)
Created attachment 254634 [details] Updated version of patch that fixes two more issues An updated version of the patch that fixes two more things: 1. Two potentially problematic calls to strncpy() (overlapping buffers) that valgrind found. 2. Makes cciss_vol_status display all drives, even those with non-512byte sectors that are "non-compliant".