Skip to content

smartmontools does not handle sat autodetect peroperly #134

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.

Activity

  1. sjorge commented on Aug 17, 2018

    @sjorge
    Author

    (@jperkin this is one of the confusing things... like since this is SmartOS specific... does this belong here? Or upstream with netbsd?)

  2. added a commit that references this issue on Sep 24, 2018
  3. added a commit that references this issue on Oct 24, 2018
  4. added a commit that references this issue on Dec 1, 2018
  5. added a commit that references this issue on Jan 10, 2019
  6. added a commit that references this issue on Feb 16, 2019
  7. added a commit that references this issue on Mar 26, 2019
  8. added a commit that references this issue on Aug 26, 2019
  9. added a commit that references this issue on Sep 2, 2019
  10. added a commit that references this issue on Oct 20, 2019
  11. added a commit that references this issue on Oct 28, 2019
  12. added a commit that references this issue on Dec 15, 2019
  13. added a commit that references this issue on Feb 12, 2020
  14. added a commit that references this issue on May 31, 2020
  15. 97 remaining items

  16. added a commit that references this issue on Jun 29, 2026
  17. added a commit that references this issue on Jul 14, 2026
  18. added a commit that references this issue on Jul 27, 2026
  19. added a commit that references this issue on Jul 30, 2026
  20. added a commit that references this issue on Aug 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions