Opened 6 months ago

Closed 5 months ago

Last modified 5 months ago

#1472 closed defect (fixed)

HP Smart Array connected disk don't need -d cciss,N when in HBA mode

Reported by: Phillip Schichtel Owned by: Christian Franke
Priority: minor Milestone: Release 7.3
Component: all Version: 7.2
Keywords: cciss linux Cc: steffen.wagner@…

Description

Hi everyone!

I'm operating a Ceph cluster on a set of HP servers, where the Smart Array controller is configured in HBA mode, so Ceph has full control over the individual disks, which works perfectly fine.

I noticed however, that smartctl as executed by ceph fails to collect the SMART data and complains e.g. "/dev/sda: requires option '-d cciss,N'". This would be correct if the device was part of a RAID managed by the HPSA controller, but it's not.

I looked at the code and in os_linux.c the function is_hpsa(device) is used to as the only condition for this error message without considering, that the device might not be part of a RAID.

Attachments (1)

hpsa-respect-hba-mode-1472.patch (1.9 KB) - added by Phillip Schichtel 5 months ago.
This patch changes the is_hspa(name) function to the is_hspa_in_raid_mode(name) function and checks the raid_level disk attribute for value "N/A", which is used by the kernel module for drives that are not logical: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/scsi/hpsa.c?id=6417f03132a6952cd17ddd8eaddbac92b61b17e0#n693

Download all attachments as: .zip

Change History (7)

comment:1 Changed 5 months ago by Christian Franke

Component: smartctlall
Keywords: linux added; hpsa removed

Patch looks good, thanks. Please also include a ChangeLog entry (email address optional) and add the following:

 // Check for SCSI host proc_name "hpsa"  <=== Update comment also
-static bool is_hpsa(const char * name)
+static bool is_hpsa_in_raid_mode(const char * name)
 {
   char path[128];
   snprintf(path, sizeof(path), "/sys/block/%s/device", name);
@@ -3247,7 +3247,21 @@
   if (strcmp(proc_name, "hpsa"))
     return false;
   ... 
+  char raid_level[4];
+  n = read(fd, raid_level, sizeof(raid_level) - 1);
+  close(fd);
+  if (n < 3)       ] <=== Add this to avoid raid_level[-1] = 0
+    return false;  ]
+  raid_level[n] = 0;
   ...

PS: Please do not set the Milestone in future submissions.

Changed 5 months ago by Phillip Schichtel

This patch changes the is_hspa(name) function to the is_hspa_in_raid_mode(name) function and checks the raid_level disk attribute for value "N/A", which is used by the kernel module for drives that are not logical: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/scsi/hpsa.c?id=6417f03132a6952cd17ddd8eaddbac92b61b17e0#n693

comment:2 Changed 5 months ago by Phillip Schichtel

@Christian Franke updated the patch with the requested changes.

comment:3 Changed 5 months ago by Christian Franke

Owner: set to Christian Franke
Status: newaccepted

Thanks!

comment:4 Changed 5 months ago by Christian Franke

Resolution: fixed
Status: acceptedclosed

Applied in r5216, thanks.

comment:5 Changed 5 months ago by Phillip Schichtel

Not sure what the typical process is: When would this release and will it be backported to older versions (and if so, by whom) ?

comment:6 Changed 5 months ago by Christian Franke

We are a very small team of volunteers maintaining smartmontools in unpaid spare time. We usually provide one release each year. Only critical patches are backported to the previous release.

Note: See TracTickets for help on using tickets.