diff options
author | Bob Beck <beck@cvs.openbsd.org> | 2020-01-04 16:22:37 +0000 |
---|---|---|
committer | Bob Beck <beck@cvs.openbsd.org> | 2020-01-04 16:22:37 +0000 |
commit | 281b16ba8e0d1d10d637bf3f91be71967dd56a4b (patch) | |
tree | a449ecb9f724b8eafbc66a0baaca5eac5556e0eb | |
parent | 972ffd99f4394b3ba1a184bcd8f41936803c346a (diff) |
Call process_worklist_item with LK_NOWAIT to skip locked vnodes from
within softdep_process_worklist. When this is called from the syncer
a vnode may be legtitimately locked by someone waiting for buffers
so we need to skip anything locked. FreeBSD appears to have a similar
change. This avoids a deadlock where the syncer ends up waiting for
the inode lock that his held by someone waiting for buffer space.
Found by bluhm@ and some genua folks
ok bluhm@
-rw-r--r-- | sys/ufs/ffs/ffs_softdep.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/ufs/ffs/ffs_softdep.c b/sys/ufs/ffs/ffs_softdep.c index bde1bcc82ad..a6349b7d969 100644 --- a/sys/ufs/ffs/ffs_softdep.c +++ b/sys/ufs/ffs/ffs_softdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ffs_softdep.c,v 1.145 2019/11/25 11:33:51 mpi Exp $ */ +/* $OpenBSD: ffs_softdep.c,v 1.146 2020/01/04 16:22:36 beck Exp $ */ /* * Copyright 1998, 2000 Marshall Kirk McKusick. All Rights Reserved. @@ -641,7 +641,7 @@ softdep_process_worklist(struct mount *matchmnt) loopcount = 1; getmicrouptime(&starttime); while (num_on_worklist > 0) { - matchcnt += process_worklist_item(matchmnt, 0); + matchcnt += process_worklist_item(matchmnt, LK_NOWAIT); /* * If a umount operation wants to run the worklist |