History log of /freebsd-10-stable/sbin/camcontrol/modeedit.c
Revision Date Author Comments
# 317966 08-May-2017 ken

MFC r317854:

When editing a mode page on a tape drive, do not clear the device
specific parameter.

Tape drives include write protect (WP), Buffered Mode and Speed
settings in the device-specific parameter. Clearing this
parameter on a mode select can have the effect of turning off
write protect or buffered mode, or changing the speed setting of
the tape drive.

Disks report DPO/FUA support via the device specific parameter
for MODE SENSE, but the bit is reserved for MODE SELECT. So we
clear this for disks (and other non-tape devices) to avoid
potential errors from the target device.

sbin/camcontrol/modeedit.c:
Clear the device-specific parameter in the mode page
header if we're not operating on a tape drive.

Sponsored by: Spectra Logic


# 314221 24-Feb-2017 ken

MFC r313893

------------------------------------------------------------------------
r313893 | ken | 2017-02-17 13:04:22 -0700 (Fri, 17 Feb 2017) | 48 lines

Add task attribute support to camcontrol(8).

Users can use the new generic argument, -Q task_attr, to specify a task
attribute (simple, ordered, head of queue, aca) for the commands issued.
The the default is simple, which works with all SCSI devices that support
tagged queueing.

This will mostly be useful for debugging target behavior in certain
situations.

You can try it out by compiling CTL with CTL_IO_DELAY turned on (in
sys/cam/ctl/ctl_io.h) and then do something like this with one of the CTL
LUNs:

ctladm delay 0:0 -l done -t 10
camcontrol tur da34 -v

And at then before the 10 second timer is up, in another terminal:

camcontrol inquiry da34 -Q ordered -v

The Inquiry should complete just after the TUR completes. Ordinarily
it would complete first because of the delay injection, but because the
task attribute is set to ordered in this case, CTL holds it up until the
previous command has completed.

sbin/camcontrol/camcontrol.c:
Add the new generic argument, -Q, which allows the user to specify
a SCSI task attribute. The user can specify task attributes by
name or numerically.

Add a new task_attr arguments to SCSI sub-functions.

sbin/camcontrol/attrib.c,
sbin/camcontrol/camcontrol.h,
sbin/camcontrol/fwdownload.c,
sbin/camcontrol/modeedit.c,
sbin/camcontrol/persist.c,
sbin/camcontrol/timestamp.c,
sbin/camcontrol/zone.c:
Add the new task_attr argument to SCSI sub-functions.

sbin/camcontrol/camcontrol.8:
Document the new -Q option, and add an example.

Sponsored by: Spectra Logic

------------------------------------------------------------------------


# 312569 21-Jan-2017 mav

MFC r311897: Add checks for received mode page length.

If our buffer is too small, we may receive part of the page, and should
not try read/write past the end of the buffer.

Reported by: Coverity
CID: 1368374, 1368375


# 312567 21-Jan-2017 mav

MFC r311636: Make 'camcontrol modepage' support subpages.


# 312565 21-Jan-2017 mav

MFC r311623: Make do_buff_decode() not read past the end of the buffer.

Abort format processing as soon as we have no enough data.


# 290385 05-Nov-2015 ngie

MFC r289913,r289916:

r289913:

Use 't' (bits) not 'i' (bytes) for describing MRIE (aka
"Method of Reporting Informational Exceptions") in the SCSI mode database as
the field described in X3T10/94-190 (revision 4; page 2, table 1) [1.] is
4 bits wide, not 4 bytes wide

1. http://ftp.t10.org/ftp/t10/document.94/94-190r4.pdf

Bug 200619
Reported by: Michael Baptist <mbaptist@isilon.com>
Submitted by: Lars Skodje <lskodje@isilon.com>
Sponsored by: EMC / Isilon Storage Division

r289916:

Limit RESOLUTION_MAX to INT_MAX, not UINT_MAX (all spelled out) so the
mode value isn't always clipped to -1 when (resolution * size) == 32, which
would have been the case with values => {4i,32b,32t}.

This seems to have been broken in r64382.

PR: 200619
Reported by: Michael Baptist
Submitted by: Lars Skodje
Sponsored by: EMC / Isilon Storage Division


# 256318 11-Oct-2013 mav

MFC r256317:
Fix mode page length calculation to remove last garbage line from the
`camcontrol mode daX -l` output.

Approved by: re (gjb)


# 256318 11-Oct-2013 mav

MFC r256317:
Fix mode page length calculation to remove last garbage line from the
`camcontrol mode daX -l` output.

Approved by: re (gjb)