From 9d575322b09b2c27493995dfffcc58ebbb97fb6e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-S=C3=A9bastien=20P=C3=A9dron?= Date: Fri, 21 Oct 2005 09:15:26 +0000 Subject: [PATCH] Apply the same fix to a potential race in the ISDOTDOT code in reiserfs_lookup() that was used to fix an actual race in ufs_lookup.c:1.78. This is not currently a hazard, but the bug would be activated by marking reiserfs as MPSAFE. Reviewed by: mux (mentor) MFC after: 2 weeks --- sys/gnu/fs/reiserfs/reiserfs_namei.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sys/gnu/fs/reiserfs/reiserfs_namei.c b/sys/gnu/fs/reiserfs/reiserfs_namei.c index 6234d1fbee9a..6ab714a91c0d 100644 --- a/sys/gnu/fs/reiserfs/reiserfs_namei.c +++ b/sys/gnu/fs/reiserfs/reiserfs_namei.c @@ -30,6 +30,7 @@ reiserfs_lookup(struct vop_cachedlookup_args *ap) int flags = cnp->cn_flags; struct thread *td = cnp->cn_thread; + struct cpu_key *saved_ino; struct vnode *vp; struct vnode *pdp; /* Saved dp during symlink work */ @@ -77,9 +78,10 @@ reiserfs_lookup(struct vop_cachedlookup_args *ap) reiserfs_log(LOG_DEBUG, "reading vnode\n"); pdp = vdp; if (flags & ISDOTDOT) { + saved_ino = (struct cpu_key *)&(de.de_dir_id); VOP_UNLOCK(pdp, 0, td); error = reiserfs_iget(vdp->v_mount, - (struct cpu_key *)&(de.de_dir_id), &vp, td); + saved_ino, &vp, td); vn_lock(pdp, LK_EXCLUSIVE | LK_RETRY, td); if (error != 0) return (error);