mirror of
https://github.com/freebsd/freebsd-src
synced 2024-09-06 17:18:32 +00:00
buf_alloc(): Stop using LK_NOWAIT, use LK_NOWITNESS
Despite the buffer taken from cache or free list, it still can be locked, due to 'lockless lookup' in getblkx() potentially operating on the freed buffers. The lock is transient, but prevents the use of LK_NOWAIT there for the goal of neutralizing WITNESS. Just use LK_NOWITNESS. Reported and tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 3 days
This commit is contained in:
parent
822d379b1f
commit
1fb00c8f10
|
@ -1722,7 +1722,7 @@ buf_alloc(struct bufdomain *bd)
|
|||
if (freebufs == bd->bd_lofreebuffers)
|
||||
bufspace_daemon_wakeup(bd);
|
||||
|
||||
error = BUF_LOCK(bp, LK_EXCLUSIVE | LK_NOWAIT, NULL);
|
||||
error = BUF_LOCK(bp, LK_EXCLUSIVE | LK_NOWITNESS, NULL);
|
||||
KASSERT(error == 0, ("%s: BUF_LOCK on free buf %p: %d.", __func__, bp,
|
||||
error));
|
||||
(void)error;
|
||||
|
|
Loading…
Reference in a new issue