aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--COVERAGE4
-rw-r--r--ChangeLog5
-rw-r--r--README2
-rw-r--r--debian/changelog2
-rw-r--r--doc/sg3_utils.812
-rwxr-xr-xexamples/sg_persist_tst.sh18
-rw-r--r--include/sg_cmds_basic.h5
-rw-r--r--lib/sg_cmds_basic.c2
-rw-r--r--sg3_utils.spec2
9 files changed, 31 insertions, 21 deletions
diff --git a/COVERAGE b/COVERAGE
index ec3777d7..b998aefc 100644
--- a/COVERAGE
+++ b/COVERAGE
@@ -62,7 +62,9 @@ REPORT REFERRALS sg_referrals, ++
REPORT SUPPORTED OPERATION CODES sg_opcodes
REPORT SUPPORTED TASK MANAGEMENT FUNCTIONS sg_opcodes
REPORT TARGET PORT GROUPS sg_rtpg, sg_stpg ++
+REPORT ZONES sg_rep_zones
REQUEST SENSE sg_requests, ++
+RESET WRITE POINTER sg_reset_wp
SANITIZE sg_sanitize
SEND DIAGNOSTIC sg_senddiag, sg_ses, ++
SET IDENTIFYING INFORMATION sg_ident, ++ (3)
@@ -116,4 +118,4 @@ THIRD PARTY COPY IN (0x83).
Douglas Gilbert
-22nd May 2014
+10th June 2014
diff --git a/ChangeLog b/ChangeLog
index 72fb0e81..3eb1705f 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 sg3_utils-1.39 [20140608] [svn: r587]
+Changelog for sg3_utils-1.39 [20140612] [svn: r588]
- sg_rep_zones: new utility for ZBC REPORT ZONES
- sg_reset_wp: new utility, ZBC RESET WRITE POINTER
- sg_ses: add --eiioe=auto|force option
@@ -28,7 +28,7 @@ Changelog for sg3_utils-1.39 [20140608] [svn: r587]
specific pages, split lto into lto5 and lto6
- add Supported block lengths and protection types
page (sbc4r01)
- - add Block device characterics extension
+ - add Block device characteristics extension
page (sbc4r02)
- sg_copy_results, sg_get_lba_status, sg_luns,
sg_read_buffer, sg_readcap, sg_referrals, sg_rtpg,
@@ -51,6 +51,7 @@ Changelog for sg3_utils-1.39 [20140608] [svn: r587]
- scripts/59-scsi-sg3_utils.rules: removed
- functionality split into two scripts:
55-scsi-sg3_id.rules + 58-scsi-sg3_symlink.rules
+ - examples/sg_persist_tst.sh: add --exclusive option
- win32: sg_scan, sg_ses and sg_log fixes
- examples/sgq_dd: re-add old utility as example
diff --git a/README b/README
index 29e775f6..9d7cb8fa 100644
--- a/README
+++ b/README
@@ -403,4 +403,4 @@ See http://sg.danny.cz/sg/tools.html
Douglas Gilbert
-8th June 2014
+12th June 2014
diff --git a/debian/changelog b/debian/changelog
index 0635ca6f..38b3b375 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -2,7 +2,7 @@ sg3-utils (1.39-0.1) unstable; urgency=low
* New upstream version
- -- Douglas Gilbert <dgilbert@interlog.com> Sun, 08 June 2014 13:00:00 -0400
+ -- Douglas Gilbert <dgilbert@interlog.com> Thu, 12 June 2014 09:00:00 -0400
sg3-utils (1.38-0.1) unstable; urgency=low
diff --git a/doc/sg3_utils.8 b/doc/sg3_utils.8
index c5e2c710..c4b6f25a 100644
--- a/doc/sg3_utils.8
+++ b/doc/sg3_utils.8
@@ -230,7 +230,7 @@ requested command.
.TP
.B 10
the \fIDEVICE\fR reports a "copy aborted". This implies another command or
-device problem has stopped and copy operation. The EXTENDED COPY family of
+device problem has stopped a copy operation. The EXTENDED COPY family of
commands (including WRITE USING TOKEN) may return this sense key.
.TP
.B 11
@@ -415,11 +415,11 @@ given, multipliers cannot be used. For example the decimal value "256" can
be given as "0x100" or "100h".
.SH SCRIPTS, EXAMPLES and UTILS
There are several bash shell scripts in the 'scripts' subdirectory that
-invoke compiled utilities (e.g. sg_readcap). The scripts start with 'scsi_'
-rather than 'sg_'. One purpose of these scripts is to call the same
-utility (e.g. sg_readcap) on multiple disks. Most of the basic compiled
-utilities only allow one device as an argument. Some distributions
-install these scripts in a visible directory (e.g. /usr/src/bin). Some of
+invoke compiled utilities (e.g. sg_readcap). Several of the scripts start
+with 'scsi_' rather than 'sg_'. One purpose of these scripts is to call the
+same utility (e.g. sg_readcap) on multiple devices. Most of the basic
+compiled utilities only allow one device as an argument. Some distributions
+install these scripts in a more visible directory (e.g. /usr/bin). Some of
these scripts have man page entries. See the README file in the 'scripts'
subdirectory.
.PP
diff --git a/examples/sg_persist_tst.sh b/examples/sg_persist_tst.sh
index c7483811..b6b926bb 100755
--- a/examples/sg_persist_tst.sh
+++ b/examples/sg_persist_tst.sh
@@ -3,19 +3,22 @@
# in the sg3_utils package. This script works as expected on the
# author's Fujitsu MAM3184, Seagate ST373455 and ST9146803SS disks.
#
-# Version 1.8 20140521
+# Version 1.9 20140612
# N.B. make sure the device name is correct for your environment.
key="123abc"
key2="333aaa"
kk=${key}
+rtype="1"
verbose=""
usage()
{
- echo "Usage: sg_persist_tst.sh [-h] [-s] [-v] <device>"
+ echo "Usage: sg_persist_tst.sh [-e] [-h] [-s] [-v] <device>"
echo " where:"
+ echo -n " -e, --exclusive exclusive access (def: write "
+ echo "exclusive)"
echo " -h, --help print usage message"
echo " -s, --second use second key"
echo " -v, --verbose more verbose output"
@@ -25,14 +28,17 @@ usage()
echo "Test SCSI Persistent Reservations with sg_persist utility."
echo "Default key is ${key} and alternate, second key is ${key2} ."
echo "Should be harmless (unless one of those keys is already in use)."
- echo "Also the APTPL bit is not set on the PR register so a power cycle"
- echo "on the device will clear it."
+ echo "The APTPL bit is not set in the PR register so a power cycle"
+ echo "on the device will clear the reservation if this script stops"
+ echo "(or is stopped) before clearing it. Tape drives only seem to "
+ echo "support 'exclusive access' type (so use '-e')."
}
opt="$1"
while test ! -z "$opt" -a -z "${opt##-*}"; do
opt=${opt#-}
case "$opt" in
+ e|-exclusive) rtype="3" ;;
h|-help) usage ; exit 0 ;;
s|-second) kk=${key2} ;;
vvv) verbose="-vvv" ;;
@@ -90,7 +96,7 @@ sleep 1
echo
echo ">>> reserve the device (based on key ${kk}):"
-sg_persist -n --out --reserve --param-rk=${kk} --prout-type=1 ${verbose} $1
+sg_persist -n --out --reserve --param-rk=${kk} --prout-type=${rtype} ${verbose} $1
sleep 1
echo
@@ -105,7 +111,7 @@ sleep 1
echo
echo ">>> now release reservation:"
-sg_persist -n --out --release --param-rk=${kk} --prout-type=1 ${verbose} $1
+sg_persist -n --out --release --param-rk=${kk} --prout-type=${rtype} ${verbose} $1
sleep 1
echo
diff --git a/include/sg_cmds_basic.h b/include/sg_cmds_basic.h
index ada13c93..39964f53 100644
--- a/include/sg_cmds_basic.h
+++ b/include/sg_cmds_basic.h
@@ -168,13 +168,14 @@ int sg_ll_test_unit_ready_progress(int sg_fd, int pack_id, int * progress,
struct sg_simple_inquiry_resp {
unsigned char peripheral_qualifier;
unsigned char peripheral_type;
- unsigned char byte_1; /* was rmb only prior to version 1.39 */
+ unsigned char byte_1; /* was 'rmb' prior to version 1.39 */
+ /* now rmb == !!(0x80 & byte_1) */
unsigned char version; /* as per recent drafts: whole of byte 2 */
unsigned char byte_3;
unsigned char byte_5;
unsigned char byte_6;
unsigned char byte_7;
- char vendor[9];
+ char vendor[9]; /* T10 field is 8 bytes, NUL char appended */
char product[17];
char revision[5];
};
diff --git a/lib/sg_cmds_basic.c b/lib/sg_cmds_basic.c
index 46e567be..27649275 100644
--- a/lib/sg_cmds_basic.c
+++ b/lib/sg_cmds_basic.c
@@ -358,7 +358,7 @@ sg_simple_inquiry(int sg_fd, struct sg_simple_inquiry_resp * inq_data,
} else
ret = 0;
- if (0 == ret) {
+ if (inq_data && (0 == ret)) {
inq_data->peripheral_qualifier = (inq_resp[0] >> 5) & 0x7;
inq_data->peripheral_type = inq_resp[0] & 0x1f;
inq_data->byte_1 = inq_resp[1];
diff --git a/sg3_utils.spec b/sg3_utils.spec
index 7e3894ba..bc222de7 100644
--- a/sg3_utils.spec
+++ b/sg3_utils.spec
@@ -79,7 +79,7 @@ fi
%{_libdir}/*.la
%changelog
-* Sun June 08 2014 - dgilbert at interlog dot com
+* Thu June 12 2014 - dgilbert at interlog dot com
- track t10 changes
* sg3_utils-1.39