From owner-svn-src-stable-7@FreeBSD.ORG Wed Apr 7 15:33:20 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6F9F71065674; Wed, 7 Apr 2010 15:33:20 +0000 (UTC) (envelope-from jh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4576F8FC2D; Wed, 7 Apr 2010 15:33:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o37FXKgd036614; Wed, 7 Apr 2010 15:33:20 GMT (envelope-from jh@svn.freebsd.org) Received: (from jh@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o37FXKrg036611; Wed, 7 Apr 2010 15:33:20 GMT (envelope-from jh@svn.freebsd.org) Message-Id: <201004071533.o37FXKrg036611@svn.freebsd.org> From: Jaakko Heinonen Date: Wed, 7 Apr 2010 15:33:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r206359 - stable/7/sys/gnu/fs/ext2fs X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Apr 2010 15:33:20 -0000 Author: jh Date: Wed Apr 7 15:33:19 2010 New Revision: 206359 URL: http://svn.freebsd.org/changeset/base/206359 Log: MFC r198940: File flags handling fixes for ext2fs: - Disallow setting of flags not supported by ext2fs. - Map EXT2_APPEND_FL to SF_APPEND. - Map EXT2_IMMUTABLE_FL to SF_IMMUTABLE. - Map EXT2_NODUMP_FL to UF_NODUMP. Note that ext2fs doesn't support user settable append and immutable flags. EXT2_NODUMP_FL is an user settable flag also on Linux. PR: kern/122047 Modified: stable/7/sys/gnu/fs/ext2fs/ext2_inode_cnv.c stable/7/sys/gnu/fs/ext2fs/ext2_vnops.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/gnu/fs/ext2fs/ext2_inode_cnv.c ============================================================================== --- stable/7/sys/gnu/fs/ext2fs/ext2_inode_cnv.c Wed Apr 7 15:29:13 2010 (r206358) +++ stable/7/sys/gnu/fs/ext2fs/ext2_inode_cnv.c Wed Apr 7 15:33:19 2010 (r206359) @@ -83,8 +83,9 @@ ext2_ei2i(ei, ip) ip->i_mtime = ei->i_mtime; ip->i_ctime = ei->i_ctime; ip->i_flags = 0; - ip->i_flags |= (ei->i_flags & EXT2_APPEND_FL) ? APPEND : 0; - ip->i_flags |= (ei->i_flags & EXT2_IMMUTABLE_FL) ? IMMUTABLE : 0; + ip->i_flags |= (ei->i_flags & EXT2_APPEND_FL) ? SF_APPEND : 0; + ip->i_flags |= (ei->i_flags & EXT2_IMMUTABLE_FL) ? SF_IMMUTABLE : 0; + ip->i_flags |= (ei->i_flags & EXT2_NODUMP_FL) ? UF_NODUMP : 0; ip->i_blocks = ei->i_blocks; ip->i_gen = ei->i_generation; ip->i_uid = ei->i_uid; @@ -121,8 +122,9 @@ ext2_i2ei(ip, ei) ei->i_ctime = ip->i_ctime; ei->i_flags = ip->i_flags; ei->i_flags = 0; - ei->i_flags |= (ip->i_flags & APPEND) ? EXT2_APPEND_FL: 0; - ei->i_flags |= (ip->i_flags & IMMUTABLE) ? EXT2_IMMUTABLE_FL: 0; + ei->i_flags |= (ip->i_flags & SF_APPEND) ? EXT2_APPEND_FL: 0; + ei->i_flags |= (ip->i_flags & SF_IMMUTABLE) ? EXT2_IMMUTABLE_FL: 0; + ei->i_flags |= (ip->i_flags & UF_NODUMP) ? EXT2_NODUMP_FL : 0; ei->i_blocks = ip->i_blocks; ei->i_generation = ip->i_gen; ei->i_uid = ip->i_uid; Modified: stable/7/sys/gnu/fs/ext2fs/ext2_vnops.c ============================================================================== --- stable/7/sys/gnu/fs/ext2fs/ext2_vnops.c Wed Apr 7 15:29:13 2010 (r206358) +++ stable/7/sys/gnu/fs/ext2fs/ext2_vnops.c Wed Apr 7 15:33:19 2010 (r206359) @@ -399,6 +399,10 @@ ext2_setattr(ap) return (EINVAL); } if (vap->va_flags != VNOVAL) { + /* Disallow flags not supported by ext2fs. */ + if (vap->va_flags & ~(SF_APPEND | SF_IMMUTABLE | UF_NODUMP)) + return (EOPNOTSUPP); + if (vp->v_mount->mnt_flag & MNT_RDONLY) return (EROFS); /*