summaryrefslogtreecommitdiffstats
path: root/sys/fs/cd9660/cd9660_lookup.c
diff options
context:
space:
mode:
authortruckman <truckman@FreeBSD.org>2005-10-16 21:41:54 +0000
committertruckman <truckman@FreeBSD.org>2005-10-16 21:41:54 +0000
commit80700e8efc4882936013101e91714d96fab5709a (patch)
tree5cff885c02c952a7da41d350ad218270ea44fef9 /sys/fs/cd9660/cd9660_lookup.c
parent199934d64b0cf348cb2f63cbe6d749d249ffdbb0 (diff)
downloadFreeBSD-src-80700e8efc4882936013101e91714d96fab5709a.zip
FreeBSD-src-80700e8efc4882936013101e91714d96fab5709a.tar.gz
Apply the same fix to a potential race in the ISDOTDOT code in
cd9660_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 cd9660 as MPSAFE. Requested by: bde
Diffstat (limited to 'sys/fs/cd9660/cd9660_lookup.c')
-rw-r--r--sys/fs/cd9660/cd9660_lookup.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/sys/fs/cd9660/cd9660_lookup.c b/sys/fs/cd9660/cd9660_lookup.c
index b89e670..59607b9 100644
--- a/sys/fs/cd9660/cd9660_lookup.c
+++ b/sys/fs/cd9660/cd9660_lookup.c
@@ -103,7 +103,7 @@ cd9660_lookup(ap)
struct vnode *tdp; /* returned by cd9660_vget_internal */
u_long bmask; /* block offset mask */
int error;
- ino_t ino = 0;
+ ino_t ino = 0, saved_ino;
int reclen;
u_short namelen;
int isoflags;
@@ -348,10 +348,11 @@ found:
* it's a relocated directory.
*/
if (flags & ISDOTDOT) {
+ saved_ino = dp->i_ino;
VOP_UNLOCK(pdp, 0, td); /* race to get the inode */
- error = cd9660_vget_internal(vdp->v_mount, dp->i_ino,
+ error = cd9660_vget_internal(vdp->v_mount, saved_ino,
LK_EXCLUSIVE, &tdp,
- dp->i_ino != ino, ep);
+ saved_ino != ino, ep);
brelse(bp);
vn_lock(pdp, LK_EXCLUSIVE | LK_RETRY, td);
if (error)
OpenPOWER on IntegriCloud