From owner-freebsd-arch@FreeBSD.ORG Mon Apr 14 08:30:21 2008 Return-Path: Delivered-To: arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E37F3106566B for ; Mon, 14 Apr 2008 08:30:21 +0000 (UTC) (envelope-from jroberson@jroberson.net) Received: from wf-out-1314.google.com (wf-out-1314.google.com [209.85.200.171]) by mx1.freebsd.org (Postfix) with ESMTP id C4D858FC15 for ; Mon, 14 Apr 2008 08:30:21 +0000 (UTC) (envelope-from jroberson@jroberson.net) Received: by wf-out-1314.google.com with SMTP id 25so1510794wfa.7 for ; Mon, 14 Apr 2008 01:30:21 -0700 (PDT) Received: by 10.142.131.18 with SMTP id e18mr1727023wfd.39.1208161821472; Mon, 14 Apr 2008 01:30:21 -0700 (PDT) Received: from ?10.0.1.199? ( [24.94.72.120]) by mx.google.com with ESMTPS id 30sm10742859wfa.2.2008.04.14.01.30.18 (version=SSLv3 cipher=OTHER); Mon, 14 Apr 2008 01:30:20 -0700 (PDT) Date: Sun, 13 Apr 2008 22:30:46 -1000 (HST) From: Jeff Roberson X-X-Sender: jroberson@desktop To: Poul-Henning Kamp In-Reply-To: <4993.1208156428@critter.freebsd.dk> Message-ID: <20080413222803.D959@desktop> References: <4993.1208156428@critter.freebsd.dk> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: arch@FreeBSD.ORG, David Schultz Subject: Re: f_offset X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Apr 2008 08:30:22 -0000 On Mon, 14 Apr 2008, Poul-Henning Kamp wrote: > In message <20080413131422.V959@desktop>, Jeff Roberson writes: > >> However, f_offset is fetched and set with a shared vnode lock for readers. > > "fetched AND set" with a shared lock ? > > How can that possibly work out sanely ? It doesn't matter which reader wins the race to update offset as long as the resulting offset is entirely valid from one. This is a userspace race otherwise. There is a complication for 64bit offsets on 32bit machines that needs some MD support. Otherwise the write happens in two instructions and can have mixed results. Jeff > > -- > 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. >