From owner-freebsd-current@FreeBSD.ORG Wed Mar 9 10:21:15 2005 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E147716A4CE for ; Wed, 9 Mar 2005 10:21:15 +0000 (GMT) Received: from wproxy.gmail.com (wproxy.gmail.com [64.233.184.200]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8059243D5F for ; Wed, 9 Mar 2005 10:21:15 +0000 (GMT) (envelope-from peadar.edwards@gmail.com) Received: by wproxy.gmail.com with SMTP id 67so215940wri for ; Wed, 09 Mar 2005 02:21:14 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:cc:in-reply-to:mime-version:content-type:references; b=N2Xj0uuzVT+qYwP5GAaQkKrJ2GHCNLVJ5VzcUsG3xg3CssiAlexJj8BMazvtOpUNj/QEZsHiJeJzm+VwGPikaQCWl/dY3suHURuY1jowGzSe2mUVO1JRexrqTakC88lB3X4hl3INa7lDqGBYcJWoBJZRsO/KEXvVoQRvVVcJAoE= Received: by 10.54.4.8 with SMTP id 8mr668509wrd; Wed, 09 Mar 2005 02:21:14 -0800 (PST) Received: by 10.54.57.20 with HTTP; Wed, 9 Mar 2005 02:21:14 -0800 (PST) Message-ID: <34cb7c84050309022130766a33@mail.gmail.com> Date: Wed, 9 Mar 2005 10:21:14 +0000 From: Peter Edwards To: Eric Kjeldergaard In-Reply-To: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_1051_32727407.1110363674902" References: cc: FreeBSD Current Subject: Re: a relatively major problem with ext2. X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Peter Edwards List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Mar 2005 10:21:16 -0000 ------=_Part_1051_32727407.1110363674902 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Disposition: inline On Tue, 8 Mar 2005 20:54:44 -0600, Eric Kjeldergaard wrote: > After a bit of discussion on the kde list regarding a problem I've > been having with kreadconfig (which uses mmap), I've stumbled (largely > directed by Michael Nottebrock) upon an ext2 bug. Michael wrote and > posted the following code: > [snip mmap failures, crash] Hi Eric, Can you try the attached patch? ------=_Part_1051_32727407.1110363674902 Content-Type: text/plain; name="ext2.txt" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="ext2.txt" Index: sys/gnu/ext2fs/ext2_vnops.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 RCS file: /home/ncvs/src/sys/gnu/ext2fs/ext2_vnops.c,v retrieving revision 1.97 diff -u -r1.97 ext2_vnops.c --- sys/gnu/ext2fs/ext2_vnops.c=0911 Jan 2005 09:10:45 -0000=091.97 +++ sys/gnu/ext2fs/ext2_vnops.c=099 Mar 2005 10:19:40 -0000 @@ -249,16 +249,21 @@ =09=09struct thread *a_td; =09} */ *ap; { +=09struct vnode *vp =3D ap->a_vp; +=09struct inode *ip; =20 -=09if (ap->a_vp->v_type =3D=3D VBLK || ap->a_vp->v_type =3D=3D VCHR) +=09if (vp->v_type =3D=3D VBLK || vp->v_type =3D=3D VCHR) =09=09return (EOPNOTSUPP); =20 =09/* =09 * Files marked append-only must be opened for appending. =09 */ -=09if ((VTOI(ap->a_vp)->i_flags & APPEND) && +=09ip =3D VTOI(vp); +=09if ((ip->i_flags & APPEND) && =09 (ap->a_mode & (FWRITE | O_APPEND)) =3D=3D FWRITE) =09=09return (EPERM); + +=09vnode_create_vobject(vp, ip->i_size, ap->a_td); =09return (0); } =20 ------=_Part_1051_32727407.1110363674902--