Summary: | geom: topology lock being dropped in dumpconf of gate, raid, & raid3 | ||
---|---|---|---|
Product: | Base System | Reporter: | Ryan Libby <rlibby> |
Component: | kern | Assignee: | Mark Johnston <markj> |
Status: | Closed FIXED | ||
Severity: | Affects Only Me | CC: | admin, bugmeister, markj |
Priority: | --- | Keywords: | crash |
Version: | CURRENT | Flags: | linimon:
mfc-stable13?
|
Hardware: | Any | ||
OS: | Any | ||
See Also: | https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=238817 |
Description
Ryan Libby
![]() ![]() I fixed a similar problem in gmirror in r333278. I suspect a similar approach would work for graid, but have not yet looked at the code. (In reply to Mark Johnston from comment #1) Thanks for the pointer, I will take a look. I ran the tests and couldn't panic on FreeBSD 12.3-STABLE # uname -a FreeBSD 12.3-STABLE #0 r372167M: Wed Jun 22 15:14:34 EEST 2022 ^Triage: clear stale flags. To submitter: is this aging PR still relevant? (In reply to Mark Linimon from comment #4) Yes, the problem still exists. I think the gate GEOM is okay, but the patch from comment 1 needs to be adapted to the raid and raid3 GEOMs. (In reply to Mark Johnston from comment #5) I spent a bit of time looking at this, but for g_raid it's quite non-trivial and hard to test. My patch for gmirror also relaxes synchronization perhaps a bit too much, in that inconsistencies are possible (e.g., disk state transitions and syncid/genid bumps happen without locking), though it fixes the larger problem. (In reply to Mark Johnston from comment #5) My comment about GEOM gate is wrong, the topology lock simply can't be dropped. Fortunately, that one is easy to fix. A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=b37b2543a23b44c78f6d78823dcfcedba46570db commit b37b2543a23b44c78f6d78823dcfcedba46570db Author: Mark Johnston <markj@FreeBSD.org> AuthorDate: 2024-10-04 14:53:57 +0000 Commit: Mark Johnston <markj@FreeBSD.org> CommitDate: 2024-10-04 15:56:34 +0000 ggate: Avoid dropping the GEOM topology lock in dumpconf In general it's not safe to drop the topology lock in these routines, as GEOM assumes that the mesh will be consistent during traversal. However, there's no reason we can't hold the topology lock across calls to g_gate_release(). (Note that g_gate_hold() can be called with the topology lock held.) PR: 238814 MFC after: 2 weeks sys/geom/gate/g_gate.c | 3 --- 1 file changed, 3 deletions(-) A commit in branch stable/14 references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=23b44ad101ca2381186aa565b6c04a978c02a35e commit 23b44ad101ca2381186aa565b6c04a978c02a35e Author: Mark Johnston <markj@FreeBSD.org> AuthorDate: 2024-10-04 14:53:57 +0000 Commit: Mark Johnston <markj@FreeBSD.org> CommitDate: 2024-10-18 12:27:13 +0000 ggate: Avoid dropping the GEOM topology lock in dumpconf In general it's not safe to drop the topology lock in these routines, as GEOM assumes that the mesh will be consistent during traversal. However, there's no reason we can't hold the topology lock across calls to g_gate_release(). (Note that g_gate_hold() can be called with the topology lock held.) PR: 238814 MFC after: 2 weeks (cherry picked from commit b37b2543a23b44c78f6d78823dcfcedba46570db) sys/geom/gate/g_gate.c | 3 --- 1 file changed, 3 deletions(-) |