diff options
author | Alexander Motin <mav@FreeBSD.org> | 2015-09-10 12:40:31 +0000 |
---|---|---|
committer | Alexander Motin <mav@FreeBSD.org> | 2015-09-10 12:40:31 +0000 |
commit | 7ac58230ea37d1b0a2095ff19bea8e928fd79bfc (patch) | |
tree | 21fdd7752fb9d89cacedc1ad0f81075a34353a18 /sys/cam/ctl/ctl_error.c | |
parent | fb606ebabc5ead6411f33056f830fa3c9131a83c (diff) | |
download | src-7ac58230ea37d1b0a2095ff19bea8e928fd79bfc.tar.gz src-7ac58230ea37d1b0a2095ff19bea8e928fd79bfc.zip |
Reimplement CTL High Availability.
CTL HA functionality was originally implemented by Copan many years ago,
but large part of the sources was never published. This change includes
clean room implementation of the missing code and fixes for many bugs.
This code supports dual-node HA with ALUA in four modes:
- Active/Unavailable without interlink between nodes;
- Active/Standby with second node handling only basic LUN discovery and
reservation, synchronizing with the first node through the interlink;
- Active/Active with both nodes processing commands and accessing the
backing storage, synchronizing with the first node through the interlink;
- Active/Active with second node working as proxy, transfering all
commands to the first node for execution through the interlink.
Unlike original Copan's implementation, depending on specific hardware,
this code uses simple custom TCP-based protocol for interlink. It has
no authentication, so it should never be enabled on public interfaces.
The code may still need some polishing, but generally it is functional.
Relnotes: yes
Sponsored by: iXsystems, Inc.
Notes
Notes:
svn path=/head/; revision=287621
Diffstat (limited to 'sys/cam/ctl/ctl_error.c')
-rw-r--r-- | sys/cam/ctl/ctl_error.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/sys/cam/ctl/ctl_error.c b/sys/cam/ctl/ctl_error.c index 8d98204271bb..8ef5176d455b 100644 --- a/sys/cam/ctl/ctl_error.c +++ b/sys/cam/ctl/ctl_error.c @@ -723,6 +723,18 @@ ctl_set_illegal_pr_release(struct ctl_scsiio *ctsio) } void +ctl_set_lun_transit(struct ctl_scsiio *ctsio) +{ + /* "Logical unit not ready, asymmetric access state transition" */ + ctl_set_sense(ctsio, + /*current_error*/ 1, + /*sense_key*/ SSD_KEY_NOT_READY, + /*asc*/ 0x04, + /*ascq*/ 0x0a, + SSD_ELEM_NONE); +} + +void ctl_set_lun_standby(struct ctl_scsiio *ctsio) { /* "Logical unit not ready, target port in standby state" */ @@ -735,6 +747,18 @@ ctl_set_lun_standby(struct ctl_scsiio *ctsio) } void +ctl_set_lun_unavail(struct ctl_scsiio *ctsio) +{ + /* "Logical unit not ready, target port in unavailable state" */ + ctl_set_sense(ctsio, + /*current_error*/ 1, + /*sense_key*/ SSD_KEY_NOT_READY, + /*asc*/ 0x04, + /*ascq*/ 0x0c, + SSD_ELEM_NONE); +} + +void ctl_set_medium_format_corrupted(struct ctl_scsiio *ctsio) { /* "Medium format corrupted" */ |