git: 06bd74e1e39c - main - GEOM: Switch g_io_deliver() locking from cp to pp.

From: Alexander Motin <mav_at_FreeBSD.org>
Date: Sun, 21 Nov 2021 23:59:18 UTC
The branch main has been updated by mav:

URL: https://cgit.FreeBSD.org/src/commit/?id=06bd74e1e39cb33b18b19a748a80b5e1d70fda17

commit 06bd74e1e39cb33b18b19a748a80b5e1d70fda17
Author:     Alexander Motin <mav@FreeBSD.org>
AuthorDate: 2021-11-21 23:50:59 +0000
Commit:     Alexander Motin <mav@FreeBSD.org>
CommitDate: 2021-11-21 23:50:59 +0000

    GEOM: Switch g_io_deliver() locking from cp to pp.
    
    Single provider may have multiple consumers, and locking one of consumers
    is not sufficient to protect the provider.  Though the only part of the
    provider this locking protects now is its statistics.
    
    Reported by:    Arka Sharma <arka.sw1988@gmail.com>
    MFC after:      2 weeks
---
 sys/geom/geom_io.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sys/geom/geom_io.c b/sys/geom/geom_io.c
index c4e9be02bf44..f32a3dc52f93 100644
--- a/sys/geom/geom_io.c
+++ b/sys/geom/geom_io.c
@@ -678,7 +678,7 @@ g_io_deliver(struct bio *bp, int error)
 	if ((g_collectstats & G_STATS_CONSUMERS) != 0 ||
 	    ((g_collectstats & G_STATS_PROVIDERS) != 0 && pp->stat != NULL))
 		binuptime(&now);
-	mtxp = mtx_pool_find(mtxpool_sleep, cp);
+	mtxp = mtx_pool_find(mtxpool_sleep, pp);
 	mtx_lock(mtxp);
 	if (g_collectstats & G_STATS_PROVIDERS)
 		devstat_end_transaction_bio_bt(pp->stat, bp, &now);