diff options
author | 2012-05-01 03:43:23 +0000 | |
---|---|---|
committer | 2012-05-01 03:43:23 +0000 | |
commit | 50902bb7879663d57b7f98c50d39fd2c75bd21d3 (patch) | |
tree | 38a589affa179c76181b0a81b58cf028f945fef1 /lib/libkvm/kvm_file2.c | |
parent | Correct the error path in execve when there's a race to single thread (diff) | |
download | wireguard-openbsd-50902bb7879663d57b7f98c50d39fd2c75bd21d3.tar.xz wireguard-openbsd-50902bb7879663d57b7f98c50d39fd2c75bd21d3.zip |
Eliminate the f_usecount ref count in struct file; instead of sleeping
at the top of closef() until all in-progress calls finish, just do the
advisory locking bits required of close() by POSIX and let whichever
thread has the last reference do the call to the file's fo_close()
method and the final cleanup.
lots of discussion with deraadt@ and others; worked out with and ok krw@
Diffstat (limited to 'lib/libkvm/kvm_file2.c')
-rw-r--r-- | lib/libkvm/kvm_file2.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/libkvm/kvm_file2.c b/lib/libkvm/kvm_file2.c index ae117c10bd9..92db2ffef6c 100644 --- a/lib/libkvm/kvm_file2.c +++ b/lib/libkvm/kvm_file2.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kvm_file2.c,v 1.23 2012/04/20 15:59:52 guenther Exp $ */ +/* $OpenBSD: kvm_file2.c,v 1.24 2012/05/01 03:43:23 guenther Exp $ */ /* * Copyright (c) 2009 Todd C. Miller <Todd.Miller@courtesan.com> @@ -497,7 +497,7 @@ fill_file2(kvm_t *kd, struct kinfo_file2 *kf, struct file *fp, u_long fpaddr, st kf->f_ops = PTRTOINT64(fp->f_ops); kf->f_offset = fp->f_offset; kf->f_data = PTRTOINT64(fp->f_data); - kf->f_usecount = fp->f_usecount; + kf->f_usecount = 0; kf->f_rxfer = fp->f_rxfer; kf->f_rwfer = fp->f_wxfer; |