Opened 5 weeks ago

Last modified 4 days ago

#1413 new defect

Some SCSI Drives spin up when using -n option.

Reported by: Simon Fairweather Owned by:
Priority: minor Milestone: undecided
Component: smartctl Version:
Keywords: scsi Cc:

Description

Some SCSI/SAS drives will spin up even if -n option is used.

This does not affect all drives.

I have noticed this only a SEAGATE drive at present.

Issue can be resolved by moving the following code to after the check for -n

if (supported_vpd_pages_p) {

delete supported_vpd_pages_p;
supported_vpd_pages_p = NULL;

}
supported_vpd_pages_p = new supported_vpd_pages(device);

to after the -n check code.

Change History (3)

comment:1 Changed 5 weeks ago by Christian Franke

Component: allsmartctl
Keywords: scsi added
Milestone: undecided

Code could also be simplified to:

  delete supported_vpd_pages_p;
  supported_vpd_pages_p = new supported_vpd_pages(device);

comment:2 Changed 4 weeks ago by Simon Fairweather

I have just moved the code as unsure of effect on simplification.

Patch

From 5c6b5e38d56d46fec72f3a2b3c2e2eae16e2f9fe Mon Sep 17 00:00:00 2001
From: SimonFair? <39065407+SimonFair@…>
Date: Thu, 24 Dec 2020 08:26:01 +0000
Subject: [PATCH] Move vpd_pages after -n processing

---

smartmontools/scsiprint.cpp | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/smartmontools/scsiprint.cpp b/smartmontools/scsiprint.cpp
index 55ab0fdc..46a07f3f 100644
--- a/smartmontools/scsiprint.cpp
+++ b/smartmontools/scsiprint.cpp
@@ -2305,12 +2305,6 @@ scsiPrintMain(scsi_device * device, const scsi_print_options & options)

bool is_tape;
bool any_output = options.drive_info;


  • if (supported_vpd_pages_p) {
  • delete supported_vpd_pages_p;
  • supported_vpd_pages_p = NULL;
  • }
  • supported_vpd_pages_p = new supported_vpd_pages(device);

-

Enable -n option for SCSI Drives

const char * powername = NULL;
bool powerchg = false;

@@ -2386,6 +2380,12 @@ scsiPrintMain(scsi_device * device, const scsi_print_options & options)

powername = "ACTIVE";

}


+ if (supported_vpd_pages_p) {
+ delete supported_vpd_pages_p;
+ supported_vpd_pages_p = NULL;
+ }
+ supported_vpd_pages_p = new supported_vpd_pages(device);
+

res = scsiGetDriveInfo(device, &peripheral_type, options.drive_info);
if (res) {

if (2 == res)

comment:3 Changed 4 days ago by Simon Fairweather

Hi, any updates when this will be reviewed/fixed?

Note: See TracTickets for help on using tickets.