From owner-dev-commits-src-all@freebsd.org Sun May 16 12:40:50 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8816D640E8B; Sun, 16 May 2021 12:40:50 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Fjhh23RQ9z3lWy; Sun, 16 May 2021 12:40:50 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 5F345187EB; Sun, 16 May 2021 12:40:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 14GCeo57047750; Sun, 16 May 2021 12:40:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 14GCeoNl047749; Sun, 16 May 2021 12:40:50 GMT (envelope-from git) Date: Sun, 16 May 2021 12:40:50 GMT Message-Id: <202105161240.14GCeoNl047749@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Edward Tomasz Napierala Subject: git: 8252fe56a0ed - main - cam: Fix race condition in dainit() MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: trasz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8252fe56a0edc95f55b203424a8f2f957959e7a4 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 May 2021 12:40:50 -0000 The branch main has been updated by trasz: URL: https://cgit.FreeBSD.org/src/commit/?id=8252fe56a0edc95f55b203424a8f2f957959e7a4 commit 8252fe56a0edc95f55b203424a8f2f957959e7a4 Author: Edward Tomasz Napierala AuthorDate: 2021-05-16 09:35:31 +0000 Commit: Edward Tomasz Napierala CommitDate: 2021-05-16 12:36:54 +0000 cam: Fix race condition in dainit() Previously, daregister() could have been called before dainit() initialized the UMA zone. This would trip a KASSERT. Reported By: pho Tested By: pho Sponsored by: NetApp, Inc. Sponsored by: Klara, Inc. --- sys/cam/scsi/scsi_da.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sys/cam/scsi/scsi_da.c b/sys/cam/scsi/scsi_da.c index 05dd9b6e7566..cf6e2e17e410 100644 --- a/sys/cam/scsi/scsi_da.c +++ b/sys/cam/scsi/scsi_da.c @@ -2001,6 +2001,10 @@ dainit(void) { cam_status status; + da_ccb_zone = uma_zcreate("da_ccb", + sizeof(struct ccb_scsiio), NULL, NULL, NULL, NULL, + UMA_ALIGN_PTR, 0); + /* * Install a global async callback. This callback will * receive async callbacks like "new device found". @@ -2016,10 +2020,6 @@ dainit(void) NULL, SHUTDOWN_PRI_DEFAULT)) == NULL) printf("dainit: shutdown event registration failed!\n"); } - - da_ccb_zone = uma_zcreate("da_ccb", - sizeof(struct ccb_scsiio), NULL, NULL, NULL, NULL, - UMA_ALIGN_PTR, 0); } /*