summaryrefslogtreecommitdiffstats
path: root/sys/fs/coda
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>2005-03-31 12:19:44 +0000
committerphk <phk@FreeBSD.org>2005-03-31 12:19:44 +0000
commit7af1e31761f34e698cdf576e46c042b327f5a612 (patch)
tree3f79498c2fd283a3ff468ae4f9116e9f395f4fa7 /sys/fs/coda
parentbf21be6c028410767b09b4755acb72b254e317d8 (diff)
downloadFreeBSD-src-7af1e31761f34e698cdf576e46c042b327f5a612.zip
FreeBSD-src-7af1e31761f34e698cdf576e46c042b327f5a612.tar.gz
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.
Diffstat (limited to 'sys/fs/coda')
-rw-r--r--sys/fs/coda/coda_fbsd.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/sys/fs/coda/coda_fbsd.c b/sys/fs/coda/coda_fbsd.c
index d68b63f..ac6ad48 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);
}
OpenPOWER on IntegriCloud