diff options
author | Alexander Bluhm <bluhm@cvs.openbsd.org> | 2020-01-10 10:33:36 +0000 |
---|---|---|
committer | Alexander Bluhm <bluhm@cvs.openbsd.org> | 2020-01-10 10:33:36 +0000 |
commit | 6c0fb7224acfdbdbd5c415c3ec0fb17df8e915f2 (patch) | |
tree | 493e941f6d545e2cfd7b301c416a79270648d45d /sys/nfs/nfs_subs.c | |
parent | 35af534ee1ffecfb9dee1d76b418166259a49ba6 (diff) |
Convert the vnode list at the mount point into a tailq. During
unmount this list is traversed and the dirty vnodes are flushed to
disk. Forced unmount expects that the list is empty after flushing,
otherwise the kernel panics with "dangling vnode". As the write
to disk can sleep, new vnodes may be inserted. If softdep is
enabled, resolving the dependencies creates new dirty vnodes and
inserts them to the list. To fix the panic, let insmntque() insert
new vnodes at the tail of the list. Then vflush() will still catch
them while traversing the list in forward direction.
OK tedu@ millert@ visa@
Diffstat (limited to 'sys/nfs/nfs_subs.c')
-rw-r--r-- | sys/nfs/nfs_subs.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/nfs/nfs_subs.c b/sys/nfs/nfs_subs.c index ff86b8a09a6..26439155739 100644 --- a/sys/nfs/nfs_subs.c +++ b/sys/nfs/nfs_subs.c @@ -1,4 +1,4 @@ -/* $OpenBSD: nfs_subs.c,v 1.140 2019/12/25 12:31:12 bluhm Exp $ */ +/* $OpenBSD: nfs_subs.c,v 1.141 2020/01/10 10:33:35 bluhm Exp $ */ /* $NetBSD: nfs_subs.c,v 1.27.4.3 1996/07/08 20:34:24 jtc Exp $ */ /* @@ -1515,7 +1515,7 @@ nfs_clearcommit(struct mount *mp) s = splbio(); loop: - LIST_FOREACH_SAFE(vp, &mp->mnt_vnodelist, v_mntvnodes, nvp) { + TAILQ_FOREACH_SAFE(vp, &mp->mnt_vnodelist, v_mntvnodes, nvp) { if (vp->v_mount != mp) /* Paranoia */ goto loop; LIST_FOREACH_SAFE(bp, &vp->v_dirtyblkhd, b_vnbufs, nbp) { |