Date: Thu, 6 Feb 2025 18:42:38 GMT From: Warner Losh <imp@FreeBSD.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: git: 4e2301260da5 - main - cam/da: explain why we have to refetch bp here. Message-ID: <202502061842.516Igcij057967@gitrepo.freebsd.org>
next in thread | raw e-mail | index | archive | help
The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=4e2301260da5cf781d3130fabe7564c5ddb629a5 commit 4e2301260da5cf781d3130fabe7564c5ddb629a5 Author: Warner Losh <imp@FreeBSD.org> AuthorDate: 2025-02-06 18:37:31 +0000 Commit: Warner Losh <imp@FreeBSD.org> CommitDate: 2025-02-06 18:42:57 +0000 cam/da: explain why we have to refetch bp here. This looks redundant. However, daerror calls cmd6workaround which will sets ccb_bp = NULL when we're failing over to a new delete method, since different delete methods have different size limitations. Unlike other error recovery, we can't just change the CDB and retry because of the latter, so we requeue it. Add a coment explaining this, lest anybody (else) be tempted to remove it. Sponsored by: Netflix --- sys/cam/scsi/scsi_da.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sys/cam/scsi/scsi_da.c b/sys/cam/scsi/scsi_da.c index c2805a71850c..1e685dc2a9e3 100644 --- a/sys/cam/scsi/scsi_da.c +++ b/sys/cam/scsi/scsi_da.c @@ -4594,6 +4594,12 @@ dadone(struct cam_periph *periph, union ccb *done_ccb) cam_periph_unlock(periph); return; } + /* + * refresh bp, since cmd6workaround may set it to NULL when + * there's no delete methos available since it pushes the bp + * back onto the work queue to reschedule it (since different + * delete methods have different size limitations). + */ bp = (struct bio *)done_ccb->ccb_h.ccb_bp; if (error != 0) { int queued_error;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202502061842.516Igcij057967>