diff options
author | daichi <daichi@FreeBSD.org> | 2008-04-25 11:37:20 +0000 |
---|---|---|
committer | daichi <daichi@FreeBSD.org> | 2008-04-25 11:37:20 +0000 |
commit | f509182dbee01017f028595092322c486af108d8 (patch) | |
tree | 0556d3e503997c948516a118ef6151ab4d298720 /sys/fs/unionfs/union_subr.c | |
parent | 567ffcd613279456f42b90d6905fdb67756f40e9 (diff) | |
download | FreeBSD-src-f509182dbee01017f028595092322c486af108d8.zip FreeBSD-src-f509182dbee01017f028595092322c486af108d8.tar.gz |
o Fixed multi thread access issue reported by Alexander V. Chernikov
(admin@su29.net)
fixed: kern/109950
PR: kern/109950
Submitted by: Alexander V. Chernikov (admin@su29.net)
Reviewed by: Masanori OZAWA (ozawa@ongs.co.jp)
MFC after: 1 week
Diffstat (limited to 'sys/fs/unionfs/union_subr.c')
-rw-r--r-- | sys/fs/unionfs/union_subr.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/sys/fs/unionfs/union_subr.c b/sys/fs/unionfs/union_subr.c index 66ac767..b3b5811 100644 --- a/sys/fs/unionfs/union_subr.c +++ b/sys/fs/unionfs/union_subr.c @@ -415,12 +415,13 @@ unionfs_get_node_status(struct unionfs_node *unp, struct thread *td, struct unionfs_node_status **unspp) { struct unionfs_node_status *unsp; + pid_t pid = td->td_proc->p_pid; KASSERT(NULL != unspp, ("null pointer")); ASSERT_VOP_ELOCKED(UNIONFSTOV(unp), "unionfs_get_node_status"); LIST_FOREACH(unsp, &(unp->un_unshead), uns_list) { - if (unsp->uns_tid == td->td_tid) { + if (unsp->uns_pid == pid) { *unspp = unsp; return; } @@ -430,7 +431,7 @@ unionfs_get_node_status(struct unionfs_node *unp, struct thread *td, MALLOC(unsp, struct unionfs_node_status *, sizeof(struct unionfs_node_status), M_TEMP, M_WAITOK | M_ZERO); - unsp->uns_tid = td->td_tid; + unsp->uns_pid = pid; LIST_INSERT_HEAD(&(unp->un_unshead), unsp, uns_list); *unspp = unsp; @@ -441,7 +442,7 @@ unionfs_get_node_status(struct unionfs_node *unp, struct thread *td, * You need exclusive lock this vnode. */ void -unionfs_tryrem_node_status(struct unionfs_node *unp, struct thread *td, +unionfs_tryrem_node_status(struct unionfs_node *unp, struct unionfs_node_status *unsp) { KASSERT(NULL != unsp, ("null pointer")); |