autofs_vnops.c revision 270898
11590Srgrimes/*-
21590Srgrimes * Copyright (c) 2014 The FreeBSD Foundation
31590Srgrimes * All rights reserved.
41590Srgrimes *
51590Srgrimes * This software was developed by Edward Tomasz Napierala under sponsorship
61590Srgrimes * from the FreeBSD Foundation.
71590Srgrimes *
81590Srgrimes * Redistribution and use in source and binary forms, with or without
91590Srgrimes * modification, are permitted provided that the following conditions
101590Srgrimes * are met:
111590Srgrimes * 1. Redistributions of source code must retain the above copyright
121590Srgrimes *    notice, this list of conditions and the following disclaimer.
131590Srgrimes * 2. Redistributions in binary form must reproduce the above copyright
141590Srgrimes *    notice, this list of conditions and the following disclaimer in the
151590Srgrimes *    documentation and/or other materials provided with the distribution.
161590Srgrimes *
171590Srgrimes * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
181590Srgrimes * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
191590Srgrimes * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
201590Srgrimes * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
211590Srgrimes * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
221590Srgrimes * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
231590Srgrimes * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
241590Srgrimes * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
251590Srgrimes * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
261590Srgrimes * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
271590Srgrimes * SUCH DAMAGE.
281590Srgrimes *
291590Srgrimes */
301590Srgrimes
3127315Scharnier#include <sys/cdefs.h>
3223693Speter__FBSDID("$FreeBSD: stable/10/sys/fs/autofs/autofs_vnops.c 270898 2014-08-31 21:49:45Z trasz $");
3327315Scharnier
341590Srgrimes#include <sys/param.h>
3599112Sobrien#include <sys/kernel.h>
3699112Sobrien#include <sys/condvar.h>
371590Srgrimes#include <sys/dirent.h>
381590Srgrimes#include <sys/fcntl.h>
391590Srgrimes#include <sys/lock.h>
4027315Scharnier#include <sys/mount.h>
411590Srgrimes#include <sys/mutex.h>
421590Srgrimes#include <sys/namei.h>
431590Srgrimes#include <sys/signalvar.h>
4423693Speter#include <sys/systm.h>
4523693Speter#include <sys/vnode.h>
461590Srgrimes#include <machine/atomic.h>
471590Srgrimes#include <vm/uma.h>
481590Srgrimes
491590Srgrimes#include <fs/autofs/autofs.h>
501590Srgrimes
51102944Sdwmalonestatic int	autofs_trigger_vn(struct vnode *vp, const char *path,
521590Srgrimes		    int pathlen, struct vnode **newvp);
531590Srgrimes
541590Srgrimesstatic int
551590Srgrimesautofs_access(struct vop_access_args *ap)
561590Srgrimes{
57229403Sed
5818550Sjoerg	/*
5918550Sjoerg	 * Nothing to do here; the only kind of access control
6018550Sjoerg	 * needed is in autofs_mkdir().
6118693Speter	 */
6218550Sjoerg
6318550Sjoerg	return (0);
6424360Simp}
651590Srgrimes
661590Srgrimesstatic int
671590Srgrimesautofs_getattr(struct vop_getattr_args *ap)
681590Srgrimes{
691590Srgrimes	struct vnode *vp, *newvp;
701590Srgrimes	struct autofs_node *anp;
711590Srgrimes	struct mount *mp;
721590Srgrimes	struct vattr *vap;
731590Srgrimes	int error;
7418325Sphk
7518325Sphk	vp = ap->a_vp;
7618693Speter	anp = vp->v_data;
7718550Sjoerg	mp = vp->v_mount;
7818325Sphk	vap = ap->a_vap;
791590Srgrimes
801590Srgrimes	KASSERT(ap->a_vp->v_type == VDIR, ("!VDIR"));
811590Srgrimes
821590Srgrimes	/*
831590Srgrimes	 * The reason we must do this is that some tree-walking software,
841590Srgrimes	 * namely fts(3), assumes that stat(".") results will not change
851590Srgrimes	 * between chdir("subdir") and chdir(".."), and fails with ENOENT
861590Srgrimes	 * otherwise.
871590Srgrimes	 */
881590Srgrimes	if (autofs_mount_on_stat && autofs_cached(anp, NULL, 0) == false &&
891590Srgrimes	    autofs_ignore_thread(curthread) == false) {
901590Srgrimes		error = autofs_trigger_vn(vp, "", 0, &newvp);
9127315Scharnier		if (error != 0)
921590Srgrimes			return (error);
931590Srgrimes
941590Srgrimes		if (newvp != NULL) {
951590Srgrimes			error = VOP_GETATTR(newvp, ap->a_vap,
961590Srgrimes			    ap->a_cred);
971590Srgrimes			vput(newvp);
9882766Sache			return (error);
9927315Scharnier		}
1001590Srgrimes	}
1011590Srgrimes
1021590Srgrimes	vap->va_type = VDIR;
1031590Srgrimes	vap->va_mode = 0755;
1041590Srgrimes	vap->va_nlink = 3; /* XXX */
1051590Srgrimes	vap->va_uid = 0;
1061590Srgrimes	vap->va_gid = 0;
1071590Srgrimes	vap->va_rdev = NODEV;
1081590Srgrimes	vap->va_fsid = mp->mnt_stat.f_fsid.val[0];
1091590Srgrimes	vap->va_fileid = anp->an_fileno;
1101590Srgrimes	vap->va_size = 512; /* XXX */
1111590Srgrimes	vap->va_blocksize = 512;
1121590Srgrimes	vap->va_mtime = anp->an_ctime;
1131590Srgrimes	vap->va_atime = anp->an_ctime;
1141590Srgrimes	vap->va_ctime = anp->an_ctime;
1151590Srgrimes	vap->va_birthtime = anp->an_ctime;
1161590Srgrimes	vap->va_gen = 0;
1171590Srgrimes	vap->va_flags = 0;
1181590Srgrimes	vap->va_rdev = 0;
1191590Srgrimes	vap->va_bytes = 512; /* XXX */
1201590Srgrimes	vap->va_filerev = 0;
1211590Srgrimes	vap->va_spare = 0;
1221590Srgrimes
1231590Srgrimes	return (0);
1241590Srgrimes}
1251590Srgrimes
1261590Srgrimes/*
1271590Srgrimes * Unlock the vnode, request automountd(8) action, and then lock it back.
1281590Srgrimes * If anything got mounted on top of the vnode, return the new filesystem's
1291590Srgrimes * root vnode in 'newvp', locked.
1301590Srgrimes */
1311590Srgrimesstatic int
132102944Sdwmaloneautofs_trigger_vn(struct vnode *vp, const char *path, int pathlen,
1331590Srgrimes    struct vnode **newvp)
13427315Scharnier{
13527315Scharnier	struct autofs_node *anp;
13627315Scharnier	struct autofs_mount *amp;
13727315Scharnier	struct autofs_softc *sc;
13827315Scharnier	int error, lock_flags;
1391590Srgrimes
1401590Srgrimes	anp = vp->v_data;
141	amp = VFSTOAUTOFS(vp->v_mount);
142	sc = amp->am_softc;
143
144	/*
145	 * Release the vnode lock, so that other operations, in partcular
146	 * mounting a filesystem on top of it, can proceed.  Increase use
147	 * count, to prevent the vnode from being deallocated and to prevent
148	 * filesystem from being unmounted.
149	 */
150	lock_flags = VOP_ISLOCKED(vp);
151	vref(vp);
152	VOP_UNLOCK(vp, 0);
153
154	sx_xlock(&sc->sc_lock);
155
156	/*
157	 * XXX: Workaround for mounting the same thing multiple times; revisit.
158	 */
159	if (vp->v_mountedhere != NULL) {
160		error = 0;
161		goto mounted;
162	}
163
164	error = autofs_trigger(anp, path, pathlen);
165mounted:
166	sx_xunlock(&sc->sc_lock);
167	vn_lock(vp, lock_flags | LK_RETRY);
168	vunref(vp);
169	if ((vp->v_iflag & VI_DOOMED) != 0) {
170		AUTOFS_DEBUG("VI_DOOMED");
171		return (ENOENT);
172	}
173
174	if (error != 0)
175		return (error);
176
177	if (vp->v_mountedhere == NULL) {
178		*newvp = NULL;
179		return (0);
180	} else {
181		/*
182		 * If the operation that succeeded was mount, then mark
183		 * the node as non-cached.  Otherwise, if someone unmounts
184		 * the filesystem before the cache times out, we will fail
185		 * to trigger.
186		 */
187		anp->an_cached = false;
188	}
189
190	error = VFS_ROOT(vp->v_mountedhere, lock_flags, newvp);
191	if (error != 0) {
192		AUTOFS_WARN("VFS_ROOT() failed with error %d", error);
193		return (error);
194	}
195
196	return (0);
197}
198
199static int
200autofs_vget_callback(struct mount *mp, void *arg, int lkflags __unused,
201    struct vnode **vpp)
202{
203
204
205	return (autofs_node_vn(arg, mp, vpp));
206}
207
208static int
209autofs_lookup(struct vop_lookup_args *ap)
210{
211	struct vnode *dvp, *newvp, **vpp;
212	struct mount *mp;
213	struct autofs_mount *amp;
214	struct autofs_node *anp, *child;
215	struct componentname *cnp;
216	int error, lock_flags;
217
218	dvp = ap->a_dvp;
219	vpp = ap->a_vpp;
220	mp = dvp->v_mount;
221	amp = VFSTOAUTOFS(mp);
222	anp = dvp->v_data;
223	cnp = ap->a_cnp;
224
225	if (cnp->cn_flags & ISDOTDOT) {
226		KASSERT(anp->an_parent != NULL, ("NULL parent"));
227		/*
228		 * Note that in this case, dvp is the child vnode, and we
229		 * are looking up the parent vnode - exactly reverse from
230		 * normal operation.  Unlocking dvp requires some rather
231		 * tricky unlock/relock dance to prevent mp from being freed;
232		 * use vn_vget_ino_gen() which takes care of all that.
233		 */
234		error = vn_vget_ino_gen(dvp, autofs_vget_callback,
235		    anp->an_parent, 0, vpp);
236		if (error != 0) {
237			AUTOFS_WARN("vn_vget_ino_gen() failed with error %d",
238			    error);
239			return (error);
240		}
241		return (error);
242	}
243
244	if (cnp->cn_namelen == 1 && cnp->cn_nameptr[0] == '.') {
245		vref(dvp);
246		*vpp = dvp;
247
248		return (0);
249	}
250
251	if (autofs_cached(anp, cnp->cn_nameptr, cnp->cn_namelen) == false &&
252	    autofs_ignore_thread(cnp->cn_thread) == false) {
253		error = autofs_trigger_vn(dvp,
254		    cnp->cn_nameptr, cnp->cn_namelen, &newvp);
255		if (error != 0)
256			return (error);
257
258		if (newvp != NULL) {
259			error = VOP_LOOKUP(newvp, ap->a_vpp, ap->a_cnp);
260
261			/*
262			 * Instead of figuring out whether our vnode should
263			 * be locked or not given the error and cnp flags,
264			 * just "copy" the lock status from vnode returned
265			 * by mounted filesystem's VOP_LOOKUP().  Get rid
266			 * of that new vnode afterwards.
267			 */
268			lock_flags = VOP_ISLOCKED(newvp);
269			if (lock_flags == 0) {
270				VOP_UNLOCK(dvp, 0);
271				vrele(newvp);
272			} else {
273				vput(newvp);
274			}
275			return (error);
276		}
277	}
278
279	if (cnp->cn_nameiop == RENAME)
280		return (EOPNOTSUPP);
281
282	AUTOFS_LOCK(amp);
283	error = autofs_node_find(anp, cnp->cn_nameptr, cnp->cn_namelen, &child);
284	if (error != 0) {
285		if ((cnp->cn_flags & ISLASTCN) && cnp->cn_nameiop == CREATE) {
286			AUTOFS_UNLOCK(amp);
287			return (EJUSTRETURN);
288		}
289
290		AUTOFS_UNLOCK(amp);
291		return (ENOENT);
292	}
293
294	/*
295	 * XXX: Dropping the node here is ok, because we never remove nodes.
296	 */
297	AUTOFS_UNLOCK(amp);
298
299	error = autofs_node_vn(child, mp, vpp);
300	if (error != 0) {
301		if ((cnp->cn_flags & ISLASTCN) && cnp->cn_nameiop == CREATE)
302			return (EJUSTRETURN);
303
304		return (error);
305	}
306
307	return (0);
308}
309
310static int
311autofs_mkdir(struct vop_mkdir_args *ap)
312{
313	struct vnode *vp;
314	struct autofs_node *anp;
315	struct autofs_mount *amp;
316	struct autofs_node *child;
317	int error;
318
319	vp = ap->a_dvp;
320	anp = vp->v_data;
321	amp = VFSTOAUTOFS(vp->v_mount);
322
323	/*
324	 * Do not allow mkdir() if the calling thread is not
325	 * automountd(8) descendant.
326	 */
327	if (autofs_ignore_thread(curthread) == false)
328		return (EPERM);
329
330	AUTOFS_LOCK(amp);
331	error = autofs_node_new(anp, amp, ap->a_cnp->cn_nameptr,
332	    ap->a_cnp->cn_namelen, &child);
333	if (error != 0) {
334		AUTOFS_UNLOCK(amp);
335		return (error);
336	}
337	AUTOFS_UNLOCK(amp);
338
339	error = autofs_node_vn(child, vp->v_mount, ap->a_vpp);
340
341	return (error);
342}
343
344static int
345autofs_readdir_one(struct uio *uio, const char *name, int fileno)
346{
347	struct dirent dirent;
348	int error, i;
349
350	memset(&dirent, 0, sizeof(dirent));
351	dirent.d_type = DT_DIR;
352	dirent.d_reclen = AUTOFS_DELEN;
353	dirent.d_fileno = fileno;
354	/* PFS_DELEN was picked to fit PFS_NAMLEN */
355	for (i = 0; i < AUTOFS_NAMELEN - 1 && name[i] != '\0'; ++i)
356		dirent.d_name[i] = name[i];
357	dirent.d_name[i] = 0;
358	dirent.d_namlen = i;
359
360	error = uiomove(&dirent, AUTOFS_DELEN, uio);
361	return (error);
362}
363
364static int
365autofs_readdir(struct vop_readdir_args *ap)
366{
367	struct vnode *vp, *newvp;
368	struct autofs_mount *amp;
369	struct autofs_node *anp, *child;
370	struct uio *uio;
371	off_t offset;
372	int error, i, resid;
373
374	vp = ap->a_vp;
375	amp = VFSTOAUTOFS(vp->v_mount);
376	anp = vp->v_data;
377	uio = ap->a_uio;
378
379	KASSERT(vp->v_type == VDIR, ("!VDIR"));
380
381	if (autofs_cached(anp, NULL, 0) == false &&
382	    autofs_ignore_thread(curthread) == false) {
383		error = autofs_trigger_vn(vp, "", 0, &newvp);
384		if (error != 0)
385			return (error);
386
387		if (newvp != NULL) {
388			error = VOP_READDIR(newvp, ap->a_uio, ap->a_cred,
389			    ap->a_eofflag, ap->a_ncookies, ap->a_cookies);
390			vput(newvp);
391			return (error);
392		}
393	}
394
395	/* only allow reading entire entries */
396	offset = uio->uio_offset;
397	resid = uio->uio_resid;
398	if (offset < 0 || offset % AUTOFS_DELEN != 0 ||
399	    (resid && resid < AUTOFS_DELEN))
400		return (EINVAL);
401	if (resid == 0)
402		return (0);
403
404	if (ap->a_eofflag != NULL)
405		*ap->a_eofflag = TRUE;
406
407	if (offset == 0 && resid >= AUTOFS_DELEN) {
408		error = autofs_readdir_one(uio, ".", anp->an_fileno);
409		if (error != 0)
410			return (error);
411		offset += AUTOFS_DELEN;
412		resid -= AUTOFS_DELEN;
413	}
414
415	if (offset == AUTOFS_DELEN && resid >= AUTOFS_DELEN) {
416		if (anp->an_parent == NULL) {
417			/*
418			 * XXX: Right?
419			 */
420			error = autofs_readdir_one(uio, "..", anp->an_fileno);
421		} else {
422			error = autofs_readdir_one(uio, "..",
423			    anp->an_parent->an_fileno);
424		}
425		if (error != 0)
426			return (error);
427		offset += AUTOFS_DELEN;
428		resid -= AUTOFS_DELEN;
429	}
430
431	i = 2; /* Account for "." and "..". */
432	AUTOFS_LOCK(amp);
433	TAILQ_FOREACH(child, &anp->an_children, an_next) {
434		if (resid < AUTOFS_DELEN) {
435			if (ap->a_eofflag != NULL)
436				*ap->a_eofflag = 0;
437			break;
438		}
439
440		/*
441		 * Skip entries returned by previous call to getdents().
442		 */
443		i++;
444		if (i * AUTOFS_DELEN <= offset)
445			continue;
446
447		error = autofs_readdir_one(uio, child->an_name,
448		    child->an_fileno);
449		if (error != 0) {
450			AUTOFS_UNLOCK(amp);
451			return (error);
452		}
453		offset += AUTOFS_DELEN;
454		resid -= AUTOFS_DELEN;
455	}
456
457	AUTOFS_UNLOCK(amp);
458	return (0);
459}
460
461static int
462autofs_reclaim(struct vop_reclaim_args *ap)
463{
464	struct vnode *vp = ap->a_vp;
465	struct autofs_node *anp = vp->v_data;
466
467	vp = ap->a_vp;
468	anp = vp->v_data;
469
470	/*
471	 * We do not free autofs_node here; instead we are
472	 * destroying them in autofs_node_delete().
473	 */
474	sx_xlock(&anp->an_vnode_lock);
475	anp->an_vnode = NULL;
476	vp->v_data = NULL;
477	sx_xunlock(&anp->an_vnode_lock);
478
479	return (0);
480}
481
482struct vop_vector autofs_vnodeops = {
483	.vop_default =		&default_vnodeops,
484
485	.vop_access =		autofs_access,
486	.vop_lookup =		autofs_lookup,
487	.vop_create =		VOP_EOPNOTSUPP,
488	.vop_getattr =		autofs_getattr,
489	.vop_link =		VOP_EOPNOTSUPP,
490	.vop_mkdir =		autofs_mkdir,
491	.vop_mknod =		VOP_EOPNOTSUPP,
492	.vop_read =		VOP_EOPNOTSUPP,
493	.vop_readdir =		autofs_readdir,
494	.vop_remove =		VOP_EOPNOTSUPP,
495	.vop_rename =		VOP_EOPNOTSUPP,
496	.vop_rmdir =		VOP_EOPNOTSUPP,
497	.vop_setattr =		VOP_EOPNOTSUPP,
498	.vop_symlink =		VOP_EOPNOTSUPP,
499	.vop_write =		VOP_EOPNOTSUPP,
500	.vop_reclaim =		autofs_reclaim,
501};
502
503int
504autofs_node_new(struct autofs_node *parent, struct autofs_mount *amp,
505    const char *name, int namelen, struct autofs_node **anpp)
506{
507	struct autofs_node *anp;
508
509	if (parent != NULL)
510		AUTOFS_ASSERT_LOCKED(parent->an_mount);
511
512	anp = uma_zalloc(autofs_node_zone, M_WAITOK | M_ZERO);
513	if (namelen >= 0)
514		anp->an_name = strndup(name, namelen, M_AUTOFS);
515	else
516		anp->an_name = strdup(name, M_AUTOFS);
517	anp->an_fileno = atomic_fetchadd_int(&amp->am_last_fileno, 1);
518	callout_init(&anp->an_callout, 1);
519	/*
520	 * The reason for SX_NOWITNESS here is that witness(4)
521	 * cannot tell vnodes apart, so the following perfectly
522	 * valid lock order...
523	 *
524	 * vnode lock A -> autofsvlk B -> vnode lock B
525	 *
526	 * ... gets reported as a LOR.
527	 */
528	sx_init_flags(&anp->an_vnode_lock, "autofsvlk", SX_NOWITNESS);
529	getnanotime(&anp->an_ctime);
530	anp->an_parent = parent;
531	anp->an_mount = amp;
532	if (parent != NULL)
533		TAILQ_INSERT_TAIL(&parent->an_children, anp, an_next);
534	TAILQ_INIT(&anp->an_children);
535
536	*anpp = anp;
537	return (0);
538}
539
540int
541autofs_node_find(struct autofs_node *parent, const char *name,
542    int namelen, struct autofs_node **anpp)
543{
544	struct autofs_node *anp;
545
546	AUTOFS_ASSERT_LOCKED(parent->an_mount);
547
548	TAILQ_FOREACH(anp, &parent->an_children, an_next) {
549		if (namelen >= 0) {
550			if (strncmp(anp->an_name, name, namelen) != 0)
551				continue;
552		} else {
553			if (strcmp(anp->an_name, name) != 0)
554				continue;
555		}
556
557		if (anpp != NULL)
558			*anpp = anp;
559		return (0);
560	}
561
562	return (ENOENT);
563}
564
565void
566autofs_node_delete(struct autofs_node *anp)
567{
568	struct autofs_node *parent;
569
570	AUTOFS_ASSERT_LOCKED(anp->an_mount);
571	KASSERT(TAILQ_EMPTY(&anp->an_children), ("have children"));
572
573	callout_drain(&anp->an_callout);
574
575	parent = anp->an_parent;
576	if (parent != NULL)
577		TAILQ_REMOVE(&parent->an_children, anp, an_next);
578	sx_destroy(&anp->an_vnode_lock);
579	free(anp->an_name, M_AUTOFS);
580	uma_zfree(autofs_node_zone, anp);
581}
582
583int
584autofs_node_vn(struct autofs_node *anp, struct mount *mp, struct vnode **vpp)
585{
586	struct vnode *vp;
587	int error;
588
589	AUTOFS_ASSERT_UNLOCKED(anp->an_mount);
590
591	sx_xlock(&anp->an_vnode_lock);
592
593	vp = anp->an_vnode;
594	if (vp != NULL) {
595		error = vget(vp, LK_EXCLUSIVE | LK_RETRY, curthread);
596		if (error != 0) {
597			AUTOFS_WARN("vget failed with error %d", error);
598			sx_xunlock(&anp->an_vnode_lock);
599			return (error);
600		}
601		if (vp->v_iflag & VI_DOOMED) {
602			/*
603			 * We got forcibly unmounted.
604			 */
605			AUTOFS_DEBUG("doomed vnode");
606			sx_xunlock(&anp->an_vnode_lock);
607			vput(vp);
608
609			return (ENOENT);
610		}
611
612		*vpp = vp;
613		sx_xunlock(&anp->an_vnode_lock);
614		return (0);
615	}
616
617	error = getnewvnode("autofs", mp, &autofs_vnodeops, &vp);
618	if (error != 0) {
619		sx_xunlock(&anp->an_vnode_lock);
620		return (error);
621	}
622
623	error = vn_lock(vp, LK_EXCLUSIVE | LK_RETRY);
624	if (error != 0) {
625		sx_xunlock(&anp->an_vnode_lock);
626		vdrop(vp);
627		return (error);
628	}
629
630	vp->v_type = VDIR;
631	if (anp->an_parent == NULL)
632		vp->v_vflag |= VV_ROOT;
633	vp->v_data = anp;
634
635	error = insmntque(vp, mp);
636	if (error != 0) {
637		AUTOFS_WARN("insmntque() failed with error %d", error);
638		sx_xunlock(&anp->an_vnode_lock);
639		return (error);
640	}
641
642	KASSERT(anp->an_vnode == NULL, ("lost race"));
643	anp->an_vnode = vp;
644
645	sx_xunlock(&anp->an_vnode_lock);
646
647	*vpp = vp;
648	return (0);
649}
650