aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDouglas Gilbert <dgilbert@interlog.com>2018-08-13 05:24:09 +0000
committerDouglas Gilbert <dgilbert@interlog.com>2018-08-13 05:24:09 +0000
commita059c857494382bb900dc23474b31c654017e461 (patch)
treec8738fed0dc06aa9a0e0f1c6cf472166ff7255b9 /src
parent9236f11e7389ec4658b06b3835ad4a6cceca9d50 (diff)
downloadsg3_utils-a059c857494382bb900dc23474b31c654017e461.tar.gz
apply most patches from sg3_utils-1.42-6.fc29.src*; sg_get_lba_status fixes; doco
git-svn-id: https://svn.bingwo.ca/repos/sg3_utils/trunk@786 6180dd3e-e324-4e3e-922d-17de1ae2f315
Diffstat (limited to 'src')
-rw-r--r--src/sg_dd.c10
-rw-r--r--src/sg_format.c6
-rw-r--r--src/sg_get_lba_status.c12
-rw-r--r--src/sg_inq.c12
-rw-r--r--src/sg_read.c6
-rw-r--r--src/sg_ses.c10
-rw-r--r--src/sg_xcopy.c3
-rw-r--r--src/sginfo.c5
-rw-r--r--src/sgm_dd.c10
-rw-r--r--src/sgp_dd.c10
10 files changed, 50 insertions, 34 deletions
diff --git a/src/sg_dd.c b/src/sg_dd.c
index 9dd5f2c1..edd8f9c3 100644
--- a/src/sg_dd.c
+++ b/src/sg_dd.c
@@ -48,9 +48,11 @@
#include <sys/time.h>
#include <sys/file.h>
#include <sys/sysmacros.h>
-#include <sys/types.h> /* needed for lseek64() */
-#include <linux/fs.h> /* <sys/mount.h> */
-#include <linux/major.h>
+#ifndef major
+#include <sys/types.h>
+#endif
+#include <linux/major.h> /* for MEM_MAJOR, SCSI_GENERIC_MAJOR, etc */
+#include <linux/fs.h> /* for BLKSSZGET and friends */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -62,7 +64,7 @@
#include "sg_unaligned.h"
#include "sg_pr2serr.h"
-static const char * version_str = "6.03 20180723";
+static const char * version_str = "6.04 20180811";
#define ME "sg_dd: "
diff --git a/src/sg_format.c b/src/sg_format.c
index 7c34b43f..ab19a8a8 100644
--- a/src/sg_format.c
+++ b/src/sg_format.c
@@ -38,7 +38,7 @@
#include "sg_pr2serr.h"
#include "sg_pt.h"
-static const char * version_str = "1.52 20180723";
+static const char * version_str = "1.53 20180809";
#define RW_ERROR_RECOVERY_PAGE 1 /* can give alternate with --mode=MP */
@@ -156,7 +156,7 @@ usage()
"[--pinfo]\n"
" [--poll=PT] [--quick] [--resize] [--rto_req] "
"[--security]\n"
- " [--six] [--size=SIZE] [--tape=FM] "
+ " [--six] [--size=LB_SZ] [--tape=FM] "
"[--timeout=SECS] [--verbose]\n"
" [--verify] [--version] [--wait] DEVICE\n"
" where:\n"
@@ -209,7 +209,7 @@ usage()
" --six|-6 use 6 byte MODE SENSE/SELECT to probe "
"disk\n"
" (def: use 10 byte MODE SENSE/SELECT)\n"
- " --size=SIZE|-s SIZE bytes per logical block, "
+ " --size=LB_SZ|-s LB_SZ bytes per logical block, "
"defaults to DEVICE's\n"
" current logical block size. Only "
"needed to\n"
diff --git a/src/sg_get_lba_status.c b/src/sg_get_lba_status.c
index 6791164c..91c7a96d 100644
--- a/src/sg_get_lba_status.c
+++ b/src/sg_get_lba_status.c
@@ -33,7 +33,7 @@
* device.
*/
-static const char * version_str = "1.17 20180626";
+static const char * version_str = "1.18 20180812"; /* sbc4r15 */
#ifndef UINT32_MAX
#define UINT32_MAX ((uint32_t)-1)
@@ -85,7 +85,8 @@ usage()
"add_status>\n"
" use twice ('-bb') for given LBA "
"provisioning status\n"
- " --element-id=EI|-e EI EI is the element identifier\n"
+ " --element-id=EI|-e EI EI is the element identifier "
+ "(def: 0)\n"
" --help|-h print out usage message\n"
" --hex|-H output in hexadecimal\n"
" --lba=LBA|-l LBA starting LBA (logical block address) "
@@ -102,10 +103,11 @@ usage()
" 2-> LBAs that are mapped\n"
" 3-> LBAs that are deallocated\n"
" 4-> LBAs that are anchored\n"
- " 5-> LBAs that may return "
+ " 16-> LBAs that may return "
"unrecovered error\n"
- " --scan-len=SL|-s SL SL in maximum scan length "
- "(unit: logical blocks)\n"
+ " --scan-len=SL|-s SL SL in maximum scan length (unit: "
+ "logical blocks)\n"
+ " (def: 0 which implies no limit)\n"
" --verbose|-v increase verbosity\n"
" --version|-V print version string and exit\n\n"
"Performs a SCSI GET LBA STATUS(16) or GET LBA STATUS(32) "
diff --git a/src/sg_inq.c b/src/sg_inq.c
index 9721486e..f2b3aa6a 100644
--- a/src/sg_inq.c
+++ b/src/sg_inq.c
@@ -49,7 +49,7 @@
#include "sg_pt_nvme.h"
#endif
-static const char * version_str = "1.96 20180626"; /* SPC-5 rev 19 */
+static const char * version_str = "1.97 20180801"; /* SPC-5 rev 19 */
/* INQUIRY notes:
* It is recommended that the initial allocation length given to a
@@ -1525,9 +1525,9 @@ decode_dev_ids(const char * leadin, uint8_t * buff, int len, int do_hex,
* Reference the 3rd byte of the first Identification descriptor
* of a page 83 reply to determine whether the reply is compliant
* with SCSI-2 or SPC-2/3 specifications. A zero value in the
- * 3rd byte indicates an SPC-2/3 conformant reply ( the field is
+ * 3rd byte indicates an SPC-2/3 conforming reply ( the field is
* reserved ). This byte will be non-zero for a SCSI-2
- * conformant page 83 reply from these EMC Symmetrix models since
+ * conforming page 83 reply from these EMC Symmetrix models since
* the 7th byte of the reply corresponds to the 4th and 5th
* nibbles of the 6-byte OUI for EMC, that is, 0x006048.
*/
@@ -1911,7 +1911,7 @@ export_dev_ids(uint8_t * buff, int len, int verbose)
break;
if ((2 == c_set) || (3 == c_set)) { /* ASCII or UTF-8 */
k = encode_whitespaces(ip, i_len);
- /* udev-conformant character encoding */
+ /* udev-conforming character encoding */
if (k > 0) {
printf("SCSI_IDENT_%s_VENDOR=", assoc_str);
for (m = 0; m < k; ++m) {
@@ -1936,7 +1936,7 @@ export_dev_ids(uint8_t * buff, int len, int verbose)
printf("SCSI_IDENT_%s_T10=", assoc_str);
if ((2 == c_set) || (3 == c_set)) {
k = encode_whitespaces(ip, i_len);
- /* udev-conformant character encoding */
+ /* udev-conforming character encoding */
for (m = 0; m < k; ++m) {
if ((ip[m] >= '0' && ip[m] <= '9') ||
(ip[m] >= 'A' && ip[m] <= 'Z') ||
@@ -3584,7 +3584,7 @@ vpd_decode(int sg_fd, const struct opts_t * op, int inhex_len)
k = encode_whitespaces((uint8_t *)obuff, len);
if (k > 0) {
printf("SCSI_IDENT_SERIAL=");
- /* udev-conformant character encoding */
+ /* udev-conforming character encoding */
for (m = 0; m < k; ++m) {
if ((obuff[m] >= '0' && obuff[m] <= '9') ||
(obuff[m] >= 'A' && obuff[m] <= 'Z') ||
diff --git a/src/sg_read.c b/src/sg_read.c
index 13058431..fb959c96 100644
--- a/src/sg_read.c
+++ b/src/sg_read.c
@@ -38,7 +38,9 @@
#include <sys/ioctl.h>
#include <sys/stat.h>
#include <sys/sysmacros.h>
-#include <sys/types.h> /* needed for lseek64() */
+#ifndef major
+#include <sys/types.h>
+#endif
#include <sys/mman.h>
#include <sys/time.h>
#include <linux/major.h>
@@ -53,7 +55,7 @@
#include "sg_pr2serr.h"
-static const char * version_str = "1.33 20180724";
+static const char * version_str = "1.34 20180811";
#define DEF_BLOCK_SIZE 512
#define DEF_BLOCKS_PER_TRANSFER 128
diff --git a/src/sg_ses.c b/src/sg_ses.c
index b977a6e6..2b05f4aa 100644
--- a/src/sg_ses.c
+++ b/src/sg_ses.c
@@ -36,7 +36,7 @@
* commands tailored for SES (enclosure) devices.
*/
-static const char * version_str = "2.42 20180724"; /* ses4r02 */
+static const char * version_str = "2.43 20180810"; /* ses4r02 */
#define MX_ALLOC_LEN ((64 * 1024) - 4) /* max allowable for big enclosures */
#define MX_ELEM_HDR 1024
@@ -4106,8 +4106,12 @@ process_status_dpage(struct sg_pt_base * ptvp, int page_code, uint8_t * resp,
goto fini;
} else if (op->do_hex) {
if (op->do_hex > 2) {
- if (4 == op->do_hex)
- printf("\n# %s:\n", cp);
+ if (op->do_hex > 3) {
+ if (4 == op->do_hex)
+ printf("\n# %s:\n", cp);
+ else
+ printf("\n# %s [0x%x]:\n", cp, page_code);
+ }
hex2stdout(resp, resp_len, -1);
} else {
printf("# Response in hex for %s:\n", cp);
diff --git a/src/sg_xcopy.c b/src/sg_xcopy.c
index aa212eaa..98a7ca15 100644
--- a/src/sg_xcopy.c
+++ b/src/sg_xcopy.c
@@ -55,7 +55,6 @@
#include <sys/types.h>
#endif
#include <linux/major.h>
-#include <linux/fs.h> /* <sys/mount.h> */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -68,7 +67,7 @@
#include "sg_unaligned.h"
#include "sg_pr2serr.h"
-static const char * version_str = "0.67 20180705";
+static const char * version_str = "0.68 20180811";
#define ME "sg_xcopy: "
diff --git a/src/sginfo.c b/src/sginfo.c
index f3b87deb..bddc9641 100644
--- a/src/sginfo.c
+++ b/src/sginfo.c
@@ -122,7 +122,7 @@
#define _GNU_SOURCE 1
#endif
-static const char * version_str = "2.41 [20180724]";
+static const char * version_str = "2.42 [20180811]";
#include <stdio.h>
#include <string.h>
@@ -3435,6 +3435,9 @@ show_devices(int raw)
if ( isdigit(entry->d_name[strlen(entry->d_name)-1]) ) {
continue;
}
+ if ( strncmp("snapshot",entry->d_name,8) == 0 ) {
+ continue;
+ }
snprintf(dev_name, sizeof(dev_name),"/dev/%s",entry->d_name);
diff --git a/src/sgm_dd.c b/src/sgm_dd.c
index 912d7593..5d97589f 100644
--- a/src/sgm_dd.c
+++ b/src/sgm_dd.c
@@ -52,9 +52,11 @@
#include <sys/time.h>
#include <sys/mman.h>
#include <sys/sysmacros.h>
-#include <sys/types.h> /* needed for lseek64() */
-#include <linux/major.h>
-#include <linux/fs.h> /* <sys/mount.h> */
+#ifndef major
+#include <sys/types.h>
+#endif
+#include <linux/major.h> /* for MEM_MAJOR, SCSI_GENERIC_MAJOR, etc */
+#include <linux/fs.h> /* for BLKSSZGET and friends */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -66,7 +68,7 @@
#include "sg_pr2serr.h"
-static const char * version_str = "1.59 20180724";
+static const char * version_str = "1.60 20180811";
#define DEF_BLOCK_SIZE 512
#define DEF_BLOCKS_PER_TRANSFER 128
diff --git a/src/sgp_dd.c b/src/sgp_dd.c
index fdbe61d9..7b760923 100644
--- a/src/sgp_dd.c
+++ b/src/sgp_dd.c
@@ -45,10 +45,12 @@
#include <sys/ioctl.h>
#include <sys/stat.h>
#include <sys/sysmacros.h>
-#include <sys/types.h> /* needed for lseek64() */
+#ifndef major
+#include <sys/types.h>
+#endif
#include <sys/time.h>
-#include <linux/major.h>
-#include <linux/fs.h> /* <sys/mount.h> */
+#include <linux/major.h> /* for MEM_MAJOR, SCSI_GENERIC_MAJOR, etc */
+#include <linux/fs.h> /* for BLKSSZGET and friends */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -60,7 +62,7 @@
#include "sg_pr2serr.h"
-static const char * version_str = "5.68 20180724";
+static const char * version_str = "5.69 20180811";
#define DEF_BLOCK_SIZE 512
#define DEF_BLOCKS_PER_TRANSFER 128