From owner-freebsd-arch@FreeBSD.ORG Thu Oct 7 14:25:17 2004 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9D00F16A4CE; Thu, 7 Oct 2004 14:25:17 +0000 (GMT) Received: from critter.freebsd.dk (critter.freebsd.dk [212.242.86.163]) by mx1.FreeBSD.org (Postfix) with ESMTP id F2EC043D39; Thu, 7 Oct 2004 14:25:16 +0000 (GMT) (envelope-from phk@critter.freebsd.dk) Received: from critter.freebsd.dk (localhost [127.0.0.1]) by critter.freebsd.dk (8.13.1/8.13.1) with ESMTP id i97EP4Bg024465; Thu, 7 Oct 2004 16:25:09 +0200 (CEST) (envelope-from phk@critter.freebsd.dk) To: Sam From: "Poul-Henning Kamp" In-Reply-To: Your message of "Thu, 07 Oct 2004 09:55:25 CDT." Date: Thu, 07 Oct 2004 16:25:04 +0200 Message-ID: <24464.1097159104@critter.freebsd.dk> Sender: phk@critter.freebsd.dk cc: John-Mark Gurney cc: freebsd-arch@freebsd.org cc: freebsd-geom@freebsd.org Subject: Re: fdisk/geom, AoE 5.2.1 X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Oct 2004 14:25:17 -0000 In message , Sam writes: >Arg. My goof. I wrote zeros, read zeros and assumed i could >write to the disk. In fact I could - even when I wanted to >read. I won't go into the details, but suffice it to say you >can't do: > >if (bp->bio_flags & BIO_READ) > // do read >else > // do write > >and expect the correct behaviour. :) Please be aware that we have _three_ I/O operations under 5.x and later: BIO_READ, BIO_WRITE and BIO_DELETE. Just return EOPNOTSUPP for BIO_DELETE. -- Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk@FreeBSD.ORG | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe Never attribute to malice what can adequately be explained by incompetence.