aboutsummaryrefslogtreecommitdiff
path: root/sys/fs
diff options
context:
space:
mode:
authorPoul-Henning Kamp <phk@FreeBSD.org>2005-03-31 12:19:44 +0000
committerPoul-Henning Kamp <phk@FreeBSD.org>2005-03-31 12:19:44 +0000
commitf4f6abcb4ea1f4c91714febe157d0eaaf3e236ec (patch)
tree3f79498c2fd283a3ff468ae4f9116e9f395f4fa7 /sys/fs
parentc06ac233d78fbc49619252994ff0fcdafc623125 (diff)
downloadsrc-f4f6abcb4ea1f4c91714febe157d0eaaf3e236ec.tar.gz
src-f4f6abcb4ea1f4c91714febe157d0eaaf3e236ec.zip
Explicitly hold a reference to the cdev we have just cloned. This
closes the race where the cdev was reclaimed before it ever made it back to devfs lookup.
Notes
Notes: svn path=/head/; revision=144389
Diffstat (limited to 'sys/fs')
-rw-r--r--sys/fs/coda/coda_fbsd.c1
-rw-r--r--sys/fs/devfs/devfs_vnops.c1
2 files changed, 2 insertions, 0 deletions
diff --git a/sys/fs/coda/coda_fbsd.c b/sys/fs/coda/coda_fbsd.c
index d68b63fb83ea..ac6ad48e8599 100644
--- a/sys/fs/coda/coda_fbsd.c
+++ b/sys/fs/coda/coda_fbsd.c
@@ -120,6 +120,7 @@ static void coda_fbsd_clone(arg, name, namelen, dev)
return;
*dev = make_dev(&codadevsw,unit2minor(u),UID_ROOT,GID_WHEEL,0600,"cfs%d",u);
+ dev_ref(*dev);
mnt = malloc(sizeof(struct coda_mntinfo), M_CODA, M_WAITOK|M_ZERO);
LIST_INSERT_HEAD(&coda_mnttbl, mnt, mi_list);
}
diff --git a/sys/fs/devfs/devfs_vnops.c b/sys/fs/devfs/devfs_vnops.c
index 8c100effa319..90139c2272ee 100644
--- a/sys/fs/devfs/devfs_vnops.c
+++ b/sys/fs/devfs/devfs_vnops.c
@@ -655,6 +655,7 @@ devfs_lookupx(ap)
devfs_populate(dmp);
dde = devfs_itode(dmp, cdev->si_inode);
+ dev_rel(cdev);
if (dde == NULL || *dde == NULL || *dde == DE_DELETED)
goto notfound;