From owner-svn-src-head@FreeBSD.ORG Wed Nov 4 06:47:14 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 87C1D106566C; Wed, 4 Nov 2009 06:47:14 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 772848FC15; Wed, 4 Nov 2009 06:47:14 +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 nA46lEI3021792; Wed, 4 Nov 2009 06:47:14 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nA46lEUg021790; Wed, 4 Nov 2009 06:47:14 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <200911040647.nA46lEUg021790@svn.freebsd.org> From: Edward Tomasz Napierala Date: Wed, 4 Nov 2009 06:47:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r198873 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Nov 2009 06:47:14 -0000 Author: trasz Date: Wed Nov 4 06:47:14 2009 New Revision: 198873 URL: http://svn.freebsd.org/changeset/base/198873 Log: While VAPPEND without VWRITE makes sense for VOP_ACCESSX(9) (e.g. to check for the permission to create subdirectory (ACE4_ADD_SUBDIRECTORY)), it doesn't really make sense for VOP_ACCESS(9). Also, many VOP_ACCESS(9) implementations don't expect that. Make sure we don't confuse them. Modified: head/sys/kern/vfs_default.c Modified: head/sys/kern/vfs_default.c ============================================================================== --- head/sys/kern/vfs_default.c Wed Nov 4 04:41:03 2009 (r198872) +++ head/sys/kern/vfs_default.c Wed Nov 4 06:47:14 2009 (r198873) @@ -353,6 +353,14 @@ vop_stdaccessx(struct vop_accessx_args * if (accmode == 0) return (0); + /* + * Many VOP_APPEND implementations don't expect VAPPEND without VWRITE + * being set, e.g. they check whether the filesystem is read-only only + * when VWRITE is set. Make sure we don't confuse them. + */ + if (accmode & VAPPEND) + accmode |= VWRITE; + return (VOP_ACCESS(ap->a_vp, accmode, ap->a_cred, ap->a_td)); }