Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 4 Nov 2009 08:07:41 +0100
From:      Pawel Jakub Dawidek <pjd@FreeBSD.org>
To:        Edward Tomasz Napierala <trasz@FreeBSD.org>
Cc:        svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org
Subject:   Re: svn commit: r198873 - head/sys/kern
Message-ID:  <20091104070741.GF2073@garage.freebsd.pl>
In-Reply-To: <200911040647.nA46lEUg021790@svn.freebsd.org>
References:  <200911040647.nA46lEUg021790@svn.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help

--0z5c7mBtSy1wdr4F
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Wed, Nov 04, 2009 at 06:47:14AM +0000, Edward Tomasz Napierala wrote:
> Author: trasz
> Date: Wed Nov  4 06:47:14 2009
> New Revision: 198873
> URL: http://svn.freebsd.org/changeset/base/198873
>=20
> Log:
>   While VAPPEND without VWRITE makes sense for VOP_ACCESSX(9) (e.g. to ch=
eck
>   for the permission to create subdirectory (ACE4_ADD_SUBDIRECTORY)), it =
doesn't
>   really make sense for VOP_ACCESS(9).  Also, many VOP_ACCESS(9) implemen=
tations
>   don't expect that.  Make sure we don't confuse them.
>=20
> Modified:
>   head/sys/kern/vfs_default.c
>=20
> Modified: head/sys/kern/vfs_default.c
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D
> --- 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 =3D=3D 0)
>  		return (0);
> =20
> +	/*
> +	 * 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.

But O_APPEND alone is legal and doesn't provide write access. This is
fine for file systems to only check for read-only in VWRITE case.
If file system you're talking about is ZFS it was simply a bug in ZFS.

> +	 */
> +	if (accmode & VAPPEND)
> +		accmode |=3D VWRITE;
>  	return (VOP_ACCESS(ap->a_vp, accmode, ap->a_cred, ap->a_td));

--=20
Pawel Jakub Dawidek                       http://www.wheel.pl
pjd@FreeBSD.org                           http://www.FreeBSD.org
FreeBSD committer                         Am I Evil? Yes, I Am!

--0z5c7mBtSy1wdr4F
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.4 (FreeBSD)

iD8DBQFK8Sg8ForvXbEpPzQRAuwQAKCvuy9SrNfUQsILfjhgETmX7giKBwCggdnc
clSfwQHH8P2Zk3JvaBy79wM=
=r1yn
-----END PGP SIGNATURE-----

--0z5c7mBtSy1wdr4F--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20091104070741.GF2073>