Summary: | kern/kern_conf.c: two 'if' statements with identical conditional expressions | ||
---|---|---|---|
Product: | Base System | Reporter: | Alexey Dokuchaev <danfe> |
Component: | kern | Assignee: | freebsd-bugs (Nobody) <bugs> |
Status: | Closed Not A Bug | ||
Severity: | Affects Only Me | CC: | kib |
Priority: | --- | Keywords: | needs-patch, needs-qa |
Version: | CURRENT | Flags: | koobs:
mfc-stable12?
koobs: mfc-stable11? |
Hardware: | Any | ||
OS: | Any |
Description
Alexey Dokuchaev
2019-05-27 09:29:39 UTC
The D_INIT flag might be set by another thread while we unlocked dev_mtx in the D_NEEDGIANT block. This is a common kernel pattern, unlock, do sleepable resource allocation, relock, and then recheck the original condition which might be invalidated by other thread meantime. Thank you for very nice explanation Kostic! I'll try to remember this pattern in the future. |