Date: Fri, 17 Jan 2003 17:11:34 -0800 (PST) From: Nate Lawson <nate@root.org> To: "Tim J. Robbins" <tjr@FreeBSD.org> Cc: cvs-all@freebsd.org, cvs-committers@freebsd.org Subject: Re: cvs commit: src/sys/fs/unionfs union_vfsops.c Message-ID: <Pine.BSF.4.21.0301171710250.51412-100000@root.org> In-Reply-To: <20030118010124.BD08D37B442@hub.freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, 17 Jan 2003, Tim J. Robbins wrote:
> Modified files:
> sys/fs/unionfs union_vfsops.c
> Log:
> Fake up a struct componentname to pass to VOP_WHITEOUT instead of passing
> NULL. union_whiteout() expects the componentname argument to be non-NULL.
> Fixes a NULL dereference panic when an existing union mount becomes the
> upper layer of a new union mount.
>
> @@ -230,7 +231,15 @@
> * supports whiteout operations.
> */
> if ((mp->mnt_flag & MNT_RDONLY) == 0) {
> - error = VOP_WHITEOUT(um->um_uppervp, NULL, LOOKUP);
> + /*
> + * XXX Fake up a struct componentname with only cn_nameiop
> + * and cn_thread valid; union_whiteout() needs to use the
> + * thread pointer to lock the vnode.
> + */
> + bzero(&fakecn, sizeof(fakecn));
> + fakecn.cn_nameiop = LOOKUP;
> + fakecn.cn_thread = td;
> + error = VOP_WHITEOUT(um->um_uppervp, &fakecn, LOOKUP);
> if (error)
> goto bad;
> }
Since lookup can sleep, does the vop need to be changed to use curthread
instead of expecting a reference to a thread passed in the struct?
-Nate
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe cvs-all" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.21.0301171710250.51412-100000>
