diff options
author | mav <mav@FreeBSD.org> | 2015-10-05 11:48:14 +0000 |
---|---|---|
committer | mav <mav@FreeBSD.org> | 2015-10-05 11:48:14 +0000 |
commit | d7b02ef70de1cfa8b23924cbaa2f1caf6dc6963c (patch) | |
tree | 4fb82ea73cd1fee203985fc2c52e114aaefe393e /sys | |
parent | 84dffeecf59de1b9101f5a087e8f50a0101b1052 (diff) | |
download | FreeBSD-src-d7b02ef70de1cfa8b23924cbaa2f1caf6dc6963c.zip FreeBSD-src-d7b02ef70de1cfa8b23924cbaa2f1caf6dc6963c.tar.gz |
MFC r288449:
Implement SPC-3 exceptions to SPC-2 RESERVE and RELEASE behavior.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/cam/ctl/ctl.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/sys/cam/ctl/ctl.c b/sys/cam/ctl/ctl.c index 4161097..ea04eef 100644 --- a/sys/cam/ctl/ctl.c +++ b/sys/cam/ctl/ctl.c @@ -5103,6 +5103,13 @@ ctl_scsi_reserve(struct ctl_scsiio *ctsio) ctl_set_reservation_conflict(ctsio); goto bailout; } + + /* SPC-3 exceptions to SPC-2 RESERVE and RELEASE behavior. */ + if (lun->flags & CTL_LUN_PR_RESERVED) { + ctl_set_success(ctsio); + goto bailout; + } + lun->flags |= CTL_LUN_RESERVED; lun->res_idx = residx; ctl_set_success(ctsio); @@ -7626,7 +7633,8 @@ retry: res_cap = (struct scsi_per_res_cap *)ctsio->kern_data_ptr; scsi_ulto2b(sizeof(*res_cap), res_cap->length); - res_cap->flags2 |= SPRI_TMV | SPRI_ALLOW_5; + res_cap->flags1 = SPRI_CRH; + res_cap->flags2 = SPRI_TMV | SPRI_ALLOW_5; type_mask = SPRI_TM_WR_EX_AR | SPRI_TM_EX_AC_RO | SPRI_TM_WR_EX_RO | |