Commit 8dab6aba authored by Alexander Motin's avatar Alexander Motin
Browse files

CAM: Keep periph_links when restoring CCB in camperiphdone().

While recovery command executed, some other commands from the periph
may complete, that may affect periph_links of this CCB.  So restoring
original CCB we must keep current periph_links as more up to date.

I've found this triggering assertions with debug kernel and suspect
some memory corruptions otherwise when spun down disk receives two
or sometimes more concurrent requests.

MFC after:	1 week
Sponsored by:	iXsystems, Inc.

(cherry picked from commit 404f0011)
parent 487fcaf8
...@@ -1441,6 +1441,7 @@ camperiphdone(struct cam_periph *periph, union ccb *done_ccb) ...@@ -1441,6 +1441,7 @@ camperiphdone(struct cam_periph *periph, union ccb *done_ccb)
* and the result will be the final one returned to the CCB owher. * and the result will be the final one returned to the CCB owher.
*/ */
saved_ccb = (union ccb *)done_ccb->ccb_h.saved_ccb_ptr; saved_ccb = (union ccb *)done_ccb->ccb_h.saved_ccb_ptr;
saved_ccb->ccb_h.periph_links = done_ccb->ccb_h.periph_links;
bcopy(saved_ccb, done_ccb, sizeof(*done_ccb)); bcopy(saved_ccb, done_ccb, sizeof(*done_ccb));
xpt_free_ccb(saved_ccb); xpt_free_ccb(saved_ccb);
if (done_ccb->ccb_h.cbfcnp != camperiphdone) if (done_ccb->ccb_h.cbfcnp != camperiphdone)
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment