Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=95f6fb578970c9dbfcaa436ff98d2f3c6bdea953
Commit:     95f6fb578970c9dbfcaa436ff98d2f3c6bdea953
Parent:     e78d5b8f1e73ab82f3fd041d05824cfee7d83a2c
Author:     Salyzyn, Mark <[EMAIL PROTECTED]>
AuthorDate: Fri Feb 8 09:01:34 2008 -0800
Committer:  James Bottomley <[EMAIL PROTECTED]>
CommitDate: Mon Feb 11 10:20:54 2008 -0600

    [SCSI] aacraid: informational sysfs value corrections
    
    Some sysfs problems reported. The serial number on late model
    controllers was truncated. Non-DASD devices (tapes and CDROMs) were
    showing up as JBOD in the level report on the physical channel.
    
    Signed-off-by: Mark Salyzyn <[EMAIL PROTECTED]>
    Signed-off-by: James Bottomley <[EMAIL PROTECTED]>
---
 drivers/scsi/aacraid/linit.c |   13 +++++++------
 1 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/drivers/scsi/aacraid/linit.c b/drivers/scsi/aacraid/linit.c
index fdfbad0..ae5f74f 100644
--- a/drivers/scsi/aacraid/linit.c
+++ b/drivers/scsi/aacraid/linit.c
@@ -494,13 +494,14 @@ static int aac_change_queue_depth(struct scsi_device 
*sdev, int depth)
 
 static ssize_t aac_show_raid_level(struct device *dev, struct device_attribute 
*attr, char *buf)
 {
-       struct scsi_device * sdev = to_scsi_device(dev);
+       struct scsi_device *sdev = to_scsi_device(dev);
+       struct aac_dev *aac = (struct aac_dev *)(sdev->host->hostdata);
        if (sdev_channel(sdev) != CONTAINER_CHANNEL)
                return snprintf(buf, PAGE_SIZE, sdev->no_uld_attach
-                 ? "Hidden\n" : "JBOD");
+                 ? "Hidden\n" :
+                 ((aac->jbod && (sdev->type == TYPE_DISK)) ? "JBOD\n" : ""));
        return snprintf(buf, PAGE_SIZE, "%s\n",
-         get_container_type(((struct aac_dev *)(sdev->host->hostdata))
-           ->fsa_dev[sdev_id(sdev)].type));
+         get_container_type(aac->fsa_dev[sdev_id(sdev)].type));
 }
 
 static struct device_attribute aac_raid_level_attr = {
@@ -860,8 +861,8 @@ ssize_t aac_show_serial_number(struct class_device 
*class_dev, char *buf)
                  le32_to_cpu(dev->adapter_info.serial[0]));
        if (len &&
          !memcmp(&dev->supplement_adapter_info.MfgPcbaSerialNo[
-           sizeof(dev->supplement_adapter_info.MfgPcbaSerialNo)+2-len],
-         buf, len))
+           sizeof(dev->supplement_adapter_info.MfgPcbaSerialNo)-len],
+         buf, len-1))
                len = snprintf(buf, PAGE_SIZE, "%.*s\n",
                  (int)sizeof(dev->supplement_adapter_info.MfgPcbaSerialNo),
                  dev->supplement_adapter_info.MfgPcbaSerialNo);
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to