From owner-cvs-all Fri Jan 17 17:11:35 2003 Delivered-To: cvs-all@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4300337B406 for ; Fri, 17 Jan 2003 17:11:34 -0800 (PST) Received: from rootlabs.com (root.org [67.118.192.226]) by mx1.FreeBSD.org (Postfix) with SMTP id 09ADD43F43 for ; Fri, 17 Jan 2003 17:11:33 -0800 (PST) (envelope-from nate@rootlabs.com) Received: (qmail 51537 invoked by uid 1000); 18 Jan 2003 01:11:34 -0000 Date: Fri, 17 Jan 2003 17:11:34 -0800 (PST) From: Nate Lawson To: "Tim J. Robbins" Cc: cvs-all@freebsd.org, cvs-committers@freebsd.org Subject: Re: cvs commit: src/sys/fs/unionfs union_vfsops.c In-Reply-To: <20030118010124.BD08D37B442@hub.freebsd.org> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG 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