diff options
author | ken <ken@FreeBSD.org> | 2017-05-08 17:02:03 +0000 |
---|---|---|
committer | ken <ken@FreeBSD.org> | 2017-05-08 17:02:03 +0000 |
commit | 3533d6ebac9d912c75378c766a595d26fd1219d9 (patch) | |
tree | 8b2c6e0911abc4d00ea27fe136781701597fa9c1 /sbin/camcontrol/camcontrol.8 | |
parent | 56c1cfd00ccae3f6deaba64fa39ed7672102e309 (diff) | |
download | FreeBSD-src-3533d6ebac9d912c75378c766a595d26fd1219d9.zip FreeBSD-src-3533d6ebac9d912c75378c766a595d26fd1219d9.tar.gz |
MFC r317774, r317776
r317774:
Add the ability to rescan or reset devices specified by peripheral
name and unit number in camcontrol(8).
Previously camcontrol(8) only supported rescanning or resetting
devices specified by bus:target:lun. This is because for
rescanning at least, you don't have a peripheral name and unit
number (e.g. da4) for devices that don't exist yet.
That is still the case after this change, but in other cases, when
the device does exist in the CAM EDT (Existing Device Table), we
do a careful lookup of the bus/target/lun if the user supplies a
peripheral name and unit number to find the bus:target:lun and then
issue the requested reset or rescan.
The lookup is done without actually opening the device in question,
since a rescan is often done to make a device go away after it has
been pulled. (This is especially true for busses/controllers, like
parallel SCSI controllers, that don't automatically detect changes
in topology.) Opening a device that is no longer there to
determine the bus/target/lun might result in error recovery actions
when the user really just wanted to make the device go away.
sbin/camcontrol/camcontrol.c:
In dorescan_or_reset(), if the use hasn't specified a
numeric argument, assume he has specified a device. Lookup
the pass(4) instance for that device using the transport
layer CAMGETPASSTHRU ioctl. If that is successful, we can
use the returned bus:target:lun to rescan or reset the
device.
Under the hood, resetting a device using XPT_RESET_DEV is
actually sent via the pass(4) device anyway. But this
provides a way for the user to specify devices in a more
convenient way, and can work on device rescans when the
device is going away, assuming it still exists in the EDT.
sbin/camcontrol/camcontrol.8:
Update the man page for the rescan and reset subcommands
to reflect that you can now use a device name and unit
number with them.
Sponsored by: Spectra Logic
r317776:
Bump the camcontrol(8) man page date.
Sponsored by: Spectra Logic
Diffstat (limited to 'sbin/camcontrol/camcontrol.8')
-rw-r--r-- | sbin/camcontrol/camcontrol.8 | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/sbin/camcontrol/camcontrol.8 b/sbin/camcontrol/camcontrol.8 index 7163bed..bfaa1bb 100644 --- a/sbin/camcontrol/camcontrol.8 +++ b/sbin/camcontrol/camcontrol.8 @@ -102,10 +102,10 @@ .Op device id .Nm .Ic rescan -.Aq all | bus Ns Op :target:lun +.Aq all | device id | bus Ns Op :target:lun .Nm .Ic reset -.Aq all | bus Ns Op :target:lun +.Aq all | device id | bus Ns Op :target:lun .Nm .Ic defects .Op device id @@ -553,12 +553,20 @@ start bit cleared and the load/eject bit set. .It Ic rescan Tell the kernel to scan all busses in the system (with the .Ar all -argument), the given bus (XPT_SCAN_BUS), or bus:target:lun +argument), the given bus (XPT_SCAN_BUS), bus:target:lun or device (XPT_SCAN_LUN) for new devices or devices that have gone away. The user may specify a scan of all busses, a single bus, or a lun. Scanning all luns on a target is not supported. +.Pp +If a device is specified by peripheral name and unit number, for instance +da4, it may only be rescanned if that device currently exists in the CAM EDT +(Existing Device Table). +If the device is no longer there (see +.Nm +devlist ), +you must use the bus:target:lun form to rescan it. .It Ic reprobe Tell the kernel to refresh the information about the device and notify the upper layer, @@ -568,8 +576,8 @@ the disk size visible to the rest of the system. .It Ic reset Tell the kernel to reset all busses in the system (with the .Ar all -argument) or the given bus (XPT_RESET_BUS) by issuing a SCSI bus -reset for that bus, or to reset the given bus:target:lun +argument), the given bus (XPT_RESET_BUS) by issuing a SCSI bus +reset for that bus, or to reset the given bus:target:lun or device (XPT_RESET_DEV), typically by issuing a BUS DEVICE RESET message after connecting to that device. Note that this can have a destructive impact |