From nobody Thu Feb 06 18:42:38 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YpmDt5wbBz5msmS; Thu, 06 Feb 2025 18:42:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YpmDt38B1z3rT9; Thu, 06 Feb 2025 18:42:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1738867358; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ah9TsoDNwUHj2eGyJ8lv8dtzQH+yAM24jAj3trPgbZw=; b=epkM0rKi1G7o8j4dNjMrbRkjpaZ+h1niL6b6RGH9T/DMrpbbXosBMrTM5z8ctCET9LbJvV gbCtXkHvr8DmxLlwQp302gOxmFLCFASXogoRCHbNMCAghh1YYZlEvi5kmTfTffW2W4K2kX 6UU8JbJhZYquB8RWuEMJVoHF0UvjA+IZsgB8NzYBInxzMwkjcdF8qQh7n8+YTQt/5lxtTR 7mVVNLvRRQ97lgLQ5T1NQrRJOlQtKne4t/F0NPGEXez34LIO0lxL41Y+eiBqnOUSyA97vs LKmdfTPeWy102aNgZrC6d64jj3fEPfx9L+pG4FplK0FdmCTfKEMvEjk6CxaZhw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1738867358; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ah9TsoDNwUHj2eGyJ8lv8dtzQH+yAM24jAj3trPgbZw=; b=pNa/qa7hxL+cALU4RXcDr++oNU2wvfJrAjqrs9+9jN3vxOIycdGYCgdxFHi2ByoY6eHQME f3YcUPprnnx/F46lX8gfNLTj8RlGcsRo/fJm3jO1lC3cyVUqDD7+XI6fFO4zrXqYX7T8Kr x1KYOfdOCu/raTPaQS+1kiro5mcVBlqHsBn0k93uXIN2tMvkzyjptYtAaJ7I/Po99riZwO gyx4wja6D5ro3rVvjUB+6B44Eto/gdeK0zbG2yf0LHGh0xv6LcJemstPw9E37vg7Tnxnwn wxpXhhbRWkWZxT+UXKcNqBugqNcrdU9tWPpidfsCdarw1MwGmjs4iN86YZY+RA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1738867358; a=rsa-sha256; cv=none; b=cWRz0L/A1Eac/wyIMcNKlW1Pll2O0pz670atyb/ioa3zWBvkBYXznAKHs1Rn78Xj7WANr/ rWf61UxnGa2VU3mvLupMKgiG7oAkxdrqBk1cLjHCsRL19TO2oYhKFpW4IY6VDby2dEBcT3 Dj9pw6gPB3IPfEKnqyJaDteHxSEPwcM4FAphV0JzwaDOOp3zcRLqcqIWAcWDkUCg4tCpgU +QE+mU0wnXePbqWKbbuPp1hrgC1NFR7DD2juuPZckcmb416+uUsgCxKBJl3MPv64sQ5q3z baQ/4YMT2s+GvHAEF1oSS7+JKk14EIKznrHka5ssyXxuIiZAVXQ/aTEWV9J2GQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YpmDt2hyfzqMN; Thu, 06 Feb 2025 18:42:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 516Igcuq057971; Thu, 6 Feb 2025 18:42:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 516Igcij057967; Thu, 6 Feb 2025 18:42:38 GMT (envelope-from git) Date: Thu, 6 Feb 2025 18:42:38 GMT Message-Id: <202502061842.516Igcij057967@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 4e2301260da5 - main - cam/da: explain why we have to refetch bp here. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4e2301260da5cf781d3130fabe7564c5ddb629a5 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=4e2301260da5cf781d3130fabe7564c5ddb629a5 commit 4e2301260da5cf781d3130fabe7564c5ddb629a5 Author: Warner Losh AuthorDate: 2025-02-06 18:37:31 +0000 Commit: Warner Losh 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;