Date: Fri, 7 May 2021 07:19:38 GMT From: Andriy Gapon <avg@FreeBSD.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: git: 8afecefd57c5 - main - storvsc: fix auto-sense reporting Message-ID: <202105070719.1477JcGo071904@gitrepo.freebsd.org>
next in thread | raw e-mail | index | archive | help
The branch main has been updated by avg: URL: https://cgit.FreeBSD.org/src/commit/?id=8afecefd57c5ac95200f43227cd00f265154acee commit 8afecefd57c5ac95200f43227cd00f265154acee Author: Andriy Gapon <avg@FreeBSD.org> AuthorDate: 2021-05-07 07:17:57 +0000 Commit: Andriy Gapon <avg@FreeBSD.org> CommitDate: 2021-05-07 07:17:57 +0000 storvsc: fix auto-sense reporting I saw a situation where the driver set CAM_AUTOSNS_VALID on a failed ccb even though SRB_STATUS_AUTOSENSE_VALID was not set in the status. The actual sense data remained all zeros. The problem seems to be that create_storvsc_request() always sets hv_storvsc_request::sense_info_len, so checking for sense_info_len != 0 is not enough to determine if any auto-sense data is actually available. Reviewed by: whu, imp MFC after: 2 weeks Sponsored by: CyberSecure Differential Revision: https://reviews.freebsd.org/D30124 --- sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c b/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c index 968de9d14e7b..702308e26a1d 100644 --- a/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c +++ b/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c @@ -2406,7 +2406,8 @@ storvsc_io_done(struct hv_storvsc_request *reqp) else ccb->csio.resid = ccb->csio.dxfer_len; - if (reqp->sense_info_len != 0) { + if ((vm_srb->srb_status & SRB_STATUS_AUTOSENSE_VALID) != 0 && + reqp->sense_info_len != 0) { csio->sense_resid = csio->sense_len - reqp->sense_info_len; ccb->ccb_h.status |= CAM_AUTOSNS_VALID; }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202105070719.1477JcGo071904>