From owner-cvs-src@FreeBSD.ORG Sat Jun 14 17:07:18 2003 Return-Path: Delivered-To: cvs-src@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 59D3437B405 for ; Sat, 14 Jun 2003 17:07:18 -0700 (PDT) Received: from rootlabs.com (root.org [67.118.192.226]) by mx1.FreeBSD.org (Postfix) with SMTP id 4CDBB43FE3 for ; Sat, 14 Jun 2003 17:07:15 -0700 (PDT) (envelope-from nate@rootlabs.com) Received: (qmail 50073 invoked by uid 1000); 15 Jun 2003 00:07:17 -0000 Date: Sat, 14 Jun 2003 17:07:17 -0700 (PDT) From: Nate Lawson To: David Schultz In-Reply-To: <20030614235633.9A83137B490@hub.freebsd.org> Message-ID: <20030614170529.C50064@root.org> References: <20030614235633.9A83137B490@hub.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: cvs-src@FreeBSD.org cc: src-committers@FreeBSD.org cc: cvs-all@FreeBSD.org Subject: Re: cvs commit: src/sys/fs/unionfs union_vnops.c X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Jun 2003 00:07:18 -0000 On Sat, 14 Jun 2003, David Schultz wrote: > If someone tries to mount a union filesystem with another unionfs as > the upper layer, fail gracefully instead of panicing. > > Revision Changes Path > 1.99 +14 -4 src/sys/fs/unionfs/union_vnops.c > > --- src/sys/fs/unionfs/union_vnops.c:1.98 Sat Jun 14 16:27:29 2003 > +++ src/sys/fs/unionfs/union_vnops.c Sat Jun 14 16:56:27 2003 > @@ -670,10 +670,20 @@ > struct vnode *uppervp; > int error = EOPNOTSUPP; > > - if ((uppervp = union_lock_upper(un, cnp->cn_thread)) != NULLVP) { > - error = VOP_WHITEOUT(un->un_uppervp, cnp, ap->a_flags); > - union_unlock_upper(uppervp, cnp->cn_thread); > - } > + switch (ap->a_flags) { > + case LOOKUP: > + error = EOPNOTSUPP; > + break; > + case CREATE: > + case DELETE: > + if ((uppervp=union_lock_upper(un,cnp->cn_thread)) != NULLVP) { > + error = VOP_WHITEOUT(un->un_uppervp, cnp, ap->a_flags); > + union_unlock_upper(uppervp, cnp->cn_thread); > + } > + break; > + default: > + panic("union_whiteout: unknown op"); > + } > return(error); > } Is that the default value you want for error? Perhaps you don't need to assign one? -Nate