Skip to content

smartmontools does not handle sat autodetect peroperly #134

@sjorge

Description

@sjorge

The OpenIndiana people have an extra patch to make smartmontools work properly when detecting SATL encoding between 16 or 12 bits...

--- smartmontools-6.5+svn4324-1.orig/scsiata.cpp
+++ smartmontools-6.5+svn4324-1/scsiata.cpp
@@ -253,8 +253,9 @@ bool sat_device::ata_pass_through(const
     ata_device::supports_multi_sector |
     ata_device::supports_48bit,
     "SAT")
-  )
-    return false;
+  ) {
+       return false;
+  }
 
     struct scsi_cmnd_io io_hdr;
     struct scsi_sense_disect sinfo;
@@ -307,7 +308,8 @@ bool sat_device::ata_pass_through(const
       if (passthru_size != SAT_ATA_PASSTHROUGH_16LEN)
         return set_err(ENOSYS, "48-bit ATA commands require SAT ATA PASS-THROUGH (16)");
       extend = 1;
-    }
+    } else
+       passthru_size = SAT_ATA_PASSTHROUGH_12LEN;
 
     cdb[0] = (SAT_ATA_PASSTHROUGH_12LEN == passthru_size) ?
              SAT_ATA_PASSTHROUGH_12 : SAT_ATA_PASSTHROUGH_16;

Here is the patch they use that was shared on #illumos.

It would be nice to see this included.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions