aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDouglas Gilbert <dgilbert@interlog.com>2022-10-28 16:35:35 +0000
committerDouglas Gilbert <dgilbert@interlog.com>2022-10-28 16:35:35 +0000
commit7b73fc26be3892abf1e91243cd107ff5bcef4a0b (patch)
treed8736cd8dc278c94fc559e3957fc5c19d42ce61f
parent7ce49e15a453f598ce6cc08933c5d961dcf86b46 (diff)
downloadsg3_utils-7b73fc26be3892abf1e91243cd107ff5bcef4a0b.tar.gz
sg_stream_ctl: --get fix better; sg_rem_rest_elem: cleanup
git-svn-id: https://svn.bingwo.ca/repos/sg3_utils/trunk@977 6180dd3e-e324-4e3e-922d-17de1ae2f315
-rw-r--r--ChangeLog2
-rw-r--r--debian/changelog2
-rw-r--r--doc/sg_rem_rest_elem.811
-rw-r--r--sg3_utils.spec2
-rw-r--r--src/sg_rem_rest_elem.c24
-rw-r--r--src/sg_stream_ctl.c4
6 files changed, 30 insertions, 15 deletions
diff --git a/ChangeLog b/ChangeLog
index 470a235a..890847d6 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 [20221027] [svn: r976]
+Changelog for pre-release sg3_utils-1.48 [20221027] [svn: r977]
- some utilities: add experimental --json[=JO] option
- sg_z_act_query: new utility for sending either a
Zone activate or Zone query command
diff --git a/debian/changelog b/debian/changelog
index dc024760..88e6e891 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> Fri, 07 Oct 2022 22:00:00 +0200
+ -- Douglas Gilbert <dgilbert@interlog.com> Fri, 28 Oct 2022 12:00:00 -0400
sg3-utils (1.47-0.1) unstable; urgency=low
diff --git a/doc/sg_rem_rest_elem.8 b/doc/sg_rem_rest_elem.8
index 81c8aa2e..13ef9c1a 100644
--- a/doc/sg_rem_rest_elem.8
+++ b/doc/sg_rem_rest_elem.8
@@ -10,10 +10,11 @@ sg_rem_rest_elem \- send SCSI remove or restore element command
.\" Add any additional description here
.PP
Sends a SCSI REMOVE ELEMENT AND TRUNCATE [RMEAT] or RESTORE ELEMENTS AND
-REBUILD [RSEAB] command to the \fIDEVICE\fR. Since both these commands have
+REBUILD [RSEAR] command to the \fIDEVICE\fR. Since both these commands have
a potentially huge impact on the \fIDEVICE\fR (similar to the FORMAT UNIT
command: destroying data and taking a long time to complete fully),
-neither is executed by default.
+they first give the user the chance to reconsider (3 times within 15
+seconds) before taking action.
.PP
Unlike the FORMAT UNIT command, these commands seem designed to work in
the background. So they will return quickly (although sbc5r01.pdf does not
@@ -22,7 +23,7 @@ where only a specified number of commands will be executed (e.g. INQUIRY and
REPORT LUNS) until the operation is complete. Other commands will receive
sense data with a sense key of NOT READY and an additional sense code
of 'Depopulation in progress' (for RMEAT) or 'Depopulation restoration in
-progress' (for RSEAB).
+progress' (for RSEAR).
.PP
The REMOVE ELEMENT AND TRUNCATE has a close relative in ZBC\-2 called the
REMOVE ELEMENT AND MODIFY ZONES [RMEMZ] command. See the sg_zone utility
@@ -39,7 +40,7 @@ Arguments to long options are mandatory for short options as well.
RC stands for Requested Capacity and is the number of logical blocks the
\fIDEVICE\fR should have after the element is removed with the RMEAT
command. The default value is 0 which allows the \fIDEVICE\fR to decide
-what the reduced capacity will be after the element removal. The RSEAB
+what the reduced capacity will be after the element removal. The RSEAR
command ignores this value.
.TP
\fB\-e\fR, \fB\-\-element\fR=\fIEID\fR
@@ -75,7 +76,7 @@ Once an element is removed successfully it is termed as "depopulated".
Depopulated elements that have the 'Restoration Allowed' (RALWD) bit
set (see sg_get_elem_status) are candidates for future restoration.
.PP
-A (storage) element of a rotating hard disk is once side of a platter
+A (storage) element of a rotating hard disk is one side of a platter
typically associated with one head. Such hard disks typically have multiple
platters with two heads per platter (i.e. one head each side of the platter).
.SH EXIT STATUS
diff --git a/sg3_utils.spec b/sg3_utils.spec
index 8d31df41..805e3348 100644
--- a/sg3_utils.spec
+++ b/sg3_utils.spec
@@ -83,7 +83,7 @@ fi
%{_libdir}/*.a
%changelog
-* Fri Oct 07 2022 - dgilbert at interlog dot com
+* Fri Oct 28 2022 - dgilbert at interlog dot com
- track t10 changes
* sg3_utils-1.48
diff --git a/src/sg_rem_rest_elem.c b/src/sg_rem_rest_elem.c
index c2ed6012..eae79798 100644
--- a/src/sg_rem_rest_elem.c
+++ b/src/sg_rem_rest_elem.c
@@ -37,7 +37,7 @@
* - RESTORE ELEMENTS AND REBUILD
*/
-static const char * version_str = "1.00 20220610";
+static const char * version_str = "1.01 20221027";
#define REMOVE_ELEM_SA 0x18
#define RESTORE_ELEMS_SA 0x19
@@ -68,9 +68,9 @@ usage()
pr2serr("Usage: "
"sg_rem_rest_elem [--capacity=RC] [--element=EID] [--help] "
"[--quick]\n"
- " [--remove] [--restore] [--verbose] "
+ " [--remove] [--restore] [--verbose] "
"[--version]\n"
- " DEVICE\n");
+ " DEVICE\n");
pr2serr(" where:\n"
" --capacity=RC|-c RC RC is requested capacity (unit: "
"block; def: 0)\n"
@@ -283,8 +283,22 @@ main(int argc, char * argv[])
ret = sg_convert_errno(err);
goto fini;
}
- if (! quick)
- sg_warn_and_wait(cmd_name, device_name, false);
+ if (! quick) {
+ int k;
+ char b[80] SG_C_CPP_ZERO_INIT;
+ char ch;
+
+ for (k = 0; k < (int)sizeof(b) - 1; ++k) {
+ ch = cmd_name[k];
+ if ('\0' == ch)
+ break;
+ else if (islower(ch))
+ b[k] = toupper(ch);
+ else
+ b[k] = ch;
+ }
+ sg_warn_and_wait(b, device_name, false);
+ }
res = sg_ll_rem_rest_elem(sg_fd, sa, req_cap, e_id, true, verbose);
ret = res;
diff --git a/src/sg_stream_ctl.c b/src/sg_stream_ctl.c
index 1f353e96..77f78eb6 100644
--- a/src/sg_stream_ctl.c
+++ b/src/sg_stream_ctl.c
@@ -35,7 +35,7 @@
* to the given SCSI device. Based on sbc4r15.pdf .
*/
-static const char * version_str = "1.12 20221026";
+static const char * version_str = "1.13 20221028";
#define STREAM_CONTROL_SA 0x14
#define GET_STREAM_STATUS_SA 0x16
@@ -457,7 +457,7 @@ main(int argc, char * argv[])
printf("Number of open streams: %u\n", num_streams);
}
maxlen = ((uint32_t)maxlen < param_dl) ? maxlen : (int)param_dl;
- for (k = 8; k < (maxlen - 8); k += 8) {
+ for (k = 8; k < maxlen; k += 8) {
stream_id = sg_get_unaligned_be16(arr + k + 2);
if (do_brief)
printf("%u\n", stream_id);