diff options
author | Warner Losh <imp@FreeBSD.org> | 2025-02-06 18:37:31 +0000 |
---|---|---|
committer | Warner Losh <imp@FreeBSD.org> | 2025-02-06 18:42:57 +0000 |
commit | 4e2301260da5cf781d3130fabe7564c5ddb629a5 (patch) | |
tree | 3fec49c1b97b0ad71e3e537812ddb0aad252c394 | |
parent | 25105fa029da88d5e02a94481733aa5a2d947ba4 (diff) |
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
-rw-r--r-- | sys/cam/scsi/scsi_da.c | 6 |
1 files changed, 6 insertions, 0 deletions
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; |