aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDouglas Gilbert <dgilbert@interlog.com>2021-12-31 19:02:04 +0000
committerDouglas Gilbert <dgilbert@interlog.com>2021-12-31 19:02:04 +0000
commita4e181c479918a5697a1826960265706049dd929 (patch)
treec2b81963f724c052d7e8bb6b5813f975fccbf289
parenta80fb97517110b355fe16a190328699d6bd9ca17 (diff)
downloadsg3_utils-a4e181c479918a5697a1826960265706049dd929.tar.gz
sg_logs: further tweak -lll to cope with missing [0,0xff] 'supported ... subpages' page
git-svn-id: https://svn.bingwo.ca/repos/sg3_utils/trunk@928 6180dd3e-e324-4e3e-922d-17de1ae2f315
-rw-r--r--ChangeLog2
-rw-r--r--README63
-rw-r--r--debian/changelog2
-rw-r--r--doc/sg_logs.822
-rw-r--r--doc/sg_zone.84
-rw-r--r--sg3_utils.spec2
-rw-r--r--src/sg_logs.c21
7 files changed, 64 insertions, 52 deletions
diff --git a/ChangeLog b/ChangeLog
index 1c7b79e4..7eafa3b0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,7 +2,7 @@ Each utility has its own version number, date of last change and
some description at the top of its ".c" file. All utilities in the main
directory have their own "man" pages. There is also a sg3_utils man page.
-Changelog for pre-release sg3_utils-1.48 [20211227] [svn: r927]
+Changelog for pre-release sg3_utils-1.48 [20211230] [svn: r928]
- sg_z_act_query: new utility for sending either a
Zone activate or Zone query command
- sg_rep_zones: add Report zone starting LBA granularity
diff --git a/README b/README
index 5b40bb00..731788b8 100644
--- a/README
+++ b/README
@@ -9,14 +9,14 @@ These utilities can be divided into three groups:
optionally the size of the data-in and data-out buffers
- one command utilities: the majority of the utilities in this package
send one SCSI command. Their names start with "sg_" while the
- remaining part of the name alludes to the command which is sent. For
+ remaining part of their name alludes to the command which is sent. For
example, "sg_inq" sends the SCSI INQUIRY command. Some utilities in
this group send one of a selection of commands, typically those
- commands have a lot it common.
+ commands have a lot it common (e.g. sg_write_x).
- copy type utilities: sg_dd, sgp_dd and sgm_dd use the Unix dd command
as a template. sg_xcopy sends the SCSI EXTENDED COPY command which in
some cases can do offloaded copies. As well as copying some of these
- utilities can compare if two data segments are the same.
+ utilities can compare if two data segments held on disks are the same.
Platforms
---------
@@ -39,39 +39,38 @@ known as "sg3-utils" (i.e. the underscore is turned into a hyphen).
Various other packages use libsgutils. The library interface is not
altered from one package release, to the next, but the library interface
may be expanded. If a utility from one release is used with a libsgutils
-from an earlier release, the runtime linking may fail. Typically package
-managers take care of these details so that runtime linking errors
-should be rare.
+from an earlier release, then the runtime linking may fail. Typically
+package managers take care of these details so that runtime linking
+errors should be rare.
Command Sets
------------
SCSI command sets are not the only storage command sets in wide use, there
are also ATA and NVMe command sets. There is a SCSI command set to
translate SCSI commands to ATA commands (called SAT: SCSI to ATA
-Translation). SAT includes an ATA PASS-THROUGH SCSI command and
-sg_sat_* utilities (there are four) are examples of using SAT. The SAS
-transport (Serial Attached SCSI) can convey ATA commands through a
-SCSI/SAS domain via its Serial ATA Tunnelled Protocol (STP).
+Translation). SAT includes an ATA PASS-THROUGH SCSI command and sg_sat_*
+utilities (there are four) are examples of using SAT. The SAS transport
+(Serial Attached SCSI) can convey ATA commands through a SCSI/SAS domain
+via its Serial ATA Tunnelled Protocol (STP).
-NVMe command sets (e.g. Admin, NVM and MI) are relatively new. There
-was an early paper on a SCSI to NVMe Translation Layer (SNTL) but it
-hasn't been standardized. The sg_inq utility will send (and decode
-the response of) a SCSI INQUIRY command if the underlying device is
-a SCSI device. If the underlying device is a NVMe controller or
-namespace, then sg_inq will send a NVMe Admin Identify command. The
-sg_ses utility (for SCSI Enclosure Services) also checks whether its
-underlying device is SCSI or NVME. In the NVMe case, sg_ses translates
-the SCSI SEND DIAGNOSTIC and READ DIAGNOSTIC RESULTS commands to the
-NVMe Management Interface (MI) SES Send and SES Receive commands
-respectively. The output of the sg_ses utility should be similar,
-irrespective of whether the "SES" device is SCSI or NVMe.
+NVMe command sets (e.g. Admin, NVM and MI) are relatively new. There was an
+early paper on a SCSI to NVMe Translation Layer (SNTL) but it hasn't been
+standardized. The sg_inq utility will send (and decode the response of) a
+SCSI INQUIRY command if the underlying device is a SCSI device. If the
+underlying device is a NVMe controller or namespace, then sg_inq will send
+a NVMe Admin Identify command and decode the response. The sg_ses utility
+(for SCSI Enclosure Services) also checks whether its underlying device is
+SCSI or NVME. In the NVMe case, sg_ses translates the SCSI SEND DIAGNOSTIC
+and READ DIAGNOSTIC RESULTS commands to the NVMe Management Interface (MI)
+SES Send and SES Receive commands respectively. The output of the sg_ses
+utility should be similar, irrespective of whether the "SES" device is
+SCSI or NVMe.
-The sg_raw utility may send NVMe Admin or NVM commands (as well as
-SCSI commands). One difficulty with a command-line utility invoking
-NVME commands is that those commands contain memory addresses for
-data-in (from the storage device) or data-out (toward the storage
-device) transfers. See the sg_raw manpage for how this difficulty is
-addressed.
+The sg_raw utility may send NVMe Admin or NVM commands (as well as SCSI
+commands). One difficulty with a command-line utility invoking NVME
+commands is that those commands contain memory addresses for data-in (from
+the storage device) or data-out (toward the storage device) transfers. See
+the sg_raw manpage for how this difficulty is addressed.
Documentation
-------------
@@ -81,8 +80,8 @@ manpage. There are utilities in the examples, testing and utils
directories that are not installed and do not have manpages. Nearly
all utilities have runtime help, usually invoked with either the '-h'
short option or the '--help' long option. There is also an overarching
-manpage called "sg3_utils". All manpages are in chapter 8 which is
-for system administration commands/utilities.
+manpage called "sg3_utils". All manpages are placed in chapter 8 which
+is for system administration commands/utilities.
The sg3_utils package and some more complex utilities have html pages:
sg3_utils: https://sg.danny.cz/sg/sg3_utils.html
@@ -105,10 +104,10 @@ file is the good reference.
The author's primary source code repository uses subversion and is on
the author's equipment (a RPi). One advantage of subversion is its
revision numbers which are simply integers starting at 1 and ascending.
-For this package the current revision is 922 . The subversion repository
+For this package the current revision is 928 . The subversion repository
is mirrored in git (using "git svn" tools) here:
https://github.com/doug-gilbert/sg3_utils
Douglas Gilbert
-20th November 2021
+31st December 2021
diff --git a/debian/changelog b/debian/changelog
index ab14cdb7..6f3a3423 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -2,7 +2,7 @@ sg3-utils (1.48-0.1) unstable; urgency=low
* New upstream version
- -- Douglas Gilbert <dgilbert@interlog.com> Sun, 26 Dec 2021 23:00:00 -0500
+ -- Douglas Gilbert <dgilbert@interlog.com> Fri, 31 Dec 2021 13:00:00 -0500
sg3-utils (1.47-0.1) unstable; urgency=low
diff --git a/doc/sg_logs.8 b/doc/sg_logs.8
index 8bafa3ac..a81b78e8 100644
--- a/doc/sg_logs.8
+++ b/doc/sg_logs.8
@@ -57,7 +57,7 @@ maintained for backward compatibility.
.PP
When no options are given, just a \fIDEVICE\fR, that is equivalent to calling
this utility with the \fI\-\-list\fR option. In that case the names of the
-supported log pages (and not any subpages) are listed out.
+supported log pages (but not subpages) are listed out.
.SH OPTIONS
Arguments to long options are mandatory for short options as well.
The options are arranged in alphabetical order based on the long
@@ -173,10 +173,12 @@ done by reading the "supported log pages" log page. When used once only
log pages, but not subpages, are listed. When used twice the "supported
log pages and subpages" log page is output. Some vendors do not list some
log pages (e.g. those without any subpages) in the "supported log pages
-and subpages" log page. To get a full overview, this option can be used
+and subpages" log page. To get a full inventory, this option can be used
three times (e.g. '\-lll') and the output of the two log pages is merged.
-In the absence of other options, the page/subpage names, but not their
-contents, are shown when this option is given.
+Even if the "supported log pages and subpages" log page is not supported
+using this option three times will yield a list from the "supported log
+pages" log page. In the absence of other options, the page/subpage names,
+but not their contents, are shown when this option is given.
.br
The '\-lll' form may be useful with the \fI\-\-All\fR option to show the
contents of all pages referred to in either the "supported log page" or
@@ -289,8 +291,8 @@ this instructs the device to store the current log page parameters (as
indicated by the DS and TSD parameter codes) in some non\-volatile location.
Hence the log parameters will be preserved across power cycles. This option
is typically not needed, especially if the GLTSD flag is clear in the
-control mode page as this instructs the device to periodically save all
-saveable log parameters to non\-volatile locations.
+control mode page which causes the \fIDEVICE\fR to periodically save all
+saveable log parameters to non\-volatile storage.
.TP
\fB\-t\fR, \fB\-\-temperature\fR
outputs the temperature. First looks in the temperature log page and if
@@ -394,11 +396,11 @@ Options with arguments or with two or more letters can have an extra '\-'
prepended. For example: both '\-pcb' and '\-\-pcb' are acceptable.
.TP
\fB\-a\fR
-outputs all the log pages supported by the device.
+outputs all the log pages supported by the \fIDEVICE\fR.
Equivalent to \fI\-\-all\fR in the main description.
.TP
\fB\-A\fR
-outputs all the log pages and subpages supported by the device.
+outputs all the log pages and subpages supported by the \fIDEVICE\fR.
Equivalent to '\-\-all \-\-all' in the main description.
.TP
\fB\-c\fR=\fIPC\fR
@@ -422,12 +424,12 @@ same action as '\-h' in this section and equivalent to \fI\-\-hex\fR in
the main description.
.TP
\fB\-l\fR
-lists the names of all logs sense pages supported by this device.
+lists the names of all logs sense pages supported by this \fIDEVICE\fR.
Equivalent to \fI\-\-list\fR in the main description.
.TP
\fB\-L\fR
lists the names of all logs sense pages and subpages supported by this
-device. Equivalent to '\-\-list \-\-list' in the main description.
+\fIDEVICE\fR. Equivalent to '\-\-list \-\-list' in the main description.
.TP
\fB\-m\fR=\fILEN\fR
request only \fILEN\fR bytes of response data. Default is 0 which is
diff --git a/doc/sg_zone.8 b/doc/sg_zone.8
index cf35c16c..53cf7cfe 100644
--- a/doc/sg_zone.8
+++ b/doc/sg_zone.8
@@ -1,4 +1,4 @@
-.TH SG_ZONE "8" "November 2021" "sg3_utils\-1.48" SG3_UTILS
+.TH SG_ZONE "8" "December 2021" "sg3_utils\-1.48" SG3_UTILS
.SH NAME
sg_zone \- send a SCSI ZONE modifying command
.SH SYNOPSIS
@@ -12,7 +12,7 @@ sg_zone \- send a SCSI ZONE modifying command
.PP
Sends a SCSI OPEN ZONE, CLOSE ZONE, FINISH ZONE, REMOVE ELEMENT AND MODIFY
ZONES or SEQUENTIALIZE ZONE command to the \fIDEVICE\fR. All but the last
-two are found in the ZBC standard (INCITS 536-\2016). The REMOVE ELEMENT AND
+two are found in the ZBC standard (INCITS 536\-2016). The REMOVE ELEMENT AND
MODIFY ZONES command was added in zbc2r07 while the SEQUENTIALIZE ZONE command
was added in zbc2r01b.
.PP
diff --git a/sg3_utils.spec b/sg3_utils.spec
index 12f13506..1d7b5a38 100644
--- a/sg3_utils.spec
+++ b/sg3_utils.spec
@@ -84,7 +84,7 @@ fi
%{_libdir}/*.la
%changelog
-* Sun Dec 26 2021 - dgilbert at interlog dot com
+* Fri Dec 31 2021 - dgilbert at interlog dot com
- track t10 changes
* sg3_utils-1.48
diff --git a/src/sg_logs.c b/src/sg_logs.c
index a5b22f85..694ee6e7 100644
--- a/src/sg_logs.c
+++ b/src/sg_logs.c
@@ -36,7 +36,7 @@
#include "sg_unaligned.h"
#include "sg_pr2serr.h"
-static const char * version_str = "1.90 20211227"; /* spc6r06 + sbc5r01 */
+static const char * version_str = "1.91 20211231"; /* spc6r06 + sbc5r01 */
#define MX_ALLOC_LEN (0xfffc)
#define SHORT_RESP_LEN 128
@@ -6953,7 +6953,8 @@ merge_both_supported(const uint8_t * supp_pgs_p, int su_p_pg_len, int pg_len)
int
main(int argc, char * argv[])
{
- int k, pg_len, res, resp_len, vb;
+ int k, pg_len, res, vb;
+ int resp_len = 0;
int su_p_pg_len = 0;
int in_len = -1;
int sg_fd = -1;
@@ -7264,9 +7265,19 @@ bad:
pr2serr("log_sense: not supported\n");
else if (SG_LIB_CAT_NOT_READY == res)
pr2serr("log_sense: device not ready\n");
- else if (SG_LIB_CAT_ILLEGAL_REQ == res)
- pr2serr("log_sense: field in cdb illegal\n");
- else if (SG_LIB_CAT_UNIT_ATTENTION == res)
+ else if (SG_LIB_CAT_ILLEGAL_REQ == res) {
+ if ((op->do_list > 2) && (SUPP_SPGS_SUBPG == op->subpg_code)) {
+ rsp_buff[0] = 0x40;
+ rsp_buff[1] = SUPP_SPGS_SUBPG;
+ pg_len = 0;
+ res = 0;
+ if (op->verbose)
+ pr2serr("log_sense: field in cdb illegal in [0,0xff], "
+ "continue with merge\n");
+ goto good;
+ } else
+ pr2serr("log_sense: field in cdb illegal\n");
+ } else if (SG_LIB_CAT_UNIT_ATTENTION == res)
pr2serr("log_sense: unit attention\n");
else if (SG_LIB_CAT_ABORTED_COMMAND == res)
pr2serr("log_sense: aborted command\n");