From owner-p4-projects@FreeBSD.ORG Tue Jun 16 15:45:27 2009 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 97C051065674; Tue, 16 Jun 2009 15:45:27 +0000 (UTC) Delivered-To: perforce@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 57AD2106566B for ; Tue, 16 Jun 2009 15:45:27 +0000 (UTC) (envelope-from truncs@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 2B88E8FC16 for ; Tue, 16 Jun 2009 15:45:27 +0000 (UTC) (envelope-from truncs@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id n5GFjRhb092025 for ; Tue, 16 Jun 2009 15:45:27 GMT (envelope-from truncs@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n5GFjRhn092023 for perforce@freebsd.org; Tue, 16 Jun 2009 15:45:27 GMT (envelope-from truncs@FreeBSD.org) Date: Tue, 16 Jun 2009 15:45:27 GMT Message-Id: <200906161545.n5GFjRhn092023@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to truncs@FreeBSD.org using -f From: Aditya Sarawgi To: Perforce Change Reviews Cc: Subject: PERFORCE change 164509 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Jun 2009 15:45:28 -0000 http://perforce.freebsd.org/chv.cgi?CH=164509 Change 164509 by truncs@aditya on 2009/06/16 15:45:15 First a check should be made for VNOVAL and then UF_* flag check should be made otherwise it won't allow mkdir to create a dir with a different attribute than the parent dir and it also gives random write errors. Affected files ... .. //depot/projects/soc2009/soc_ext2fs/src/sys/gnu/fs/ext2fs/ext2_vnops.c#10 edit Differences ... ==== //depot/projects/soc2009/soc_ext2fs/src/sys/gnu/fs/ext2fs/ext2_vnops.c#10 (text+ko) ==== @@ -243,7 +243,7 @@ if (ap->a_vp->v_type == VBLK || ap->a_vp->v_type == VCHR) return (EOPNOTSUPP); - + /* * Files marked append-only must be opened for appending. */ @@ -295,7 +295,7 @@ if (vp->v_type == VBLK || vp->v_type == VCHR) return (EOPNOTSUPP); - + /* * Disallow write attempts on read-only file systems; * unless the file is a socket, fifo, or a block or @@ -380,12 +380,6 @@ struct thread *td = curthread; int error; /* - * Deny setting of UF flags - */ - if(vap->va_flags & UF_SETTABLE) - return (EOPNOTSUPP); - - /* * Check for unsettable attributes. */ if ((vap->va_type != VNON) || (vap->va_nlink != VNOVAL) || @@ -397,7 +391,11 @@ if (vap->va_flags != VNOVAL) { if (vp->v_mount->mnt_flag & MNT_RDONLY) return (EROFS); - + /* + * Deny setting of UF flags + */ + if(vap->va_flags & UF_SETTABLE) + return(EOPNOTSUPP); /* * Callers may only modify the file flags on objects they * have VADMIN rights for. @@ -421,11 +419,9 @@ ip->i_flags = vap->va_flags; } else { if (ip->i_flags - & (SF_NOUNLINK | SF_IMMUTABLE | SF_APPEND) || - (vap->va_flags & UF_SETTABLE) != vap->va_flags) + & (SF_NOUNLINK | SF_IMMUTABLE | SF_APPEND)) return (EPERM); ip->i_flags &= SF_SETTABLE; - ip->i_flags |= (vap->va_flags & UF_SETTABLE); } ip->i_flag |= IN_CHANGE; if (vap->va_flags & (SF_IMMUTABLE | SF_APPEND)) @@ -1177,7 +1173,6 @@ if (cnp->cn_flags & ISWHITEOUT) ip->i_flags |= UF_OPAQUE; error = ext2_update(tvp, 1); - /* * Bump link count in parent directory * to reflect work done below. Should @@ -1189,7 +1184,6 @@ error = ext2_update(dvp, 1); if (error) goto bad; - /* Initialize directory with "." and ".." from static template. */ if (EXT2_HAS_INCOMPAT_FEATURE(ip->i_e2fs, EXT2F_INCOMPAT_FTYPE))