From owner-freebsd-current@FreeBSD.ORG Wed Mar 28 17:59:39 2007 Return-Path: X-Original-To: freebsd-current@freebsd.org Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 67B3B16A412 for ; Wed, 28 Mar 2007 17:59:39 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from cyrus.watson.org (cyrus.watson.org [209.31.154.42]) by mx1.freebsd.org (Postfix) with ESMTP id DABBC13C44C for ; Wed, 28 Mar 2007 17:59:38 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from fledge.watson.org (fledge.watson.org [209.31.154.41]) by cyrus.watson.org (Postfix) with ESMTP id 9906B47300; Wed, 28 Mar 2007 12:59:34 -0500 (EST) Date: Wed, 28 Mar 2007 18:59:34 +0100 (BST) From: Robert Watson X-X-Sender: robert@fledge.watson.org To: Ivan Voras In-Reply-To: Message-ID: <20070328185815.I1185@fledge.watson.org> References: <7ad7ddd90703280238r5dd3f30ftc1641926ecdf44a8@mail.gmail.com> <7ad7ddd90703280611p5c0ca4e1y600315551391a813@mail.gmail.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: freebsd-current@freebsd.org Subject: Re: NFS write() calls lead to read() calls? X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Mar 2007 17:59:39 -0000 On Wed, 28 Mar 2007, Ivan Voras wrote: > Ulrich Spoerlein wrote: > >> What kind of C program or script did you have in mind? My C-foo is very >> weak ... > > If you have python installed, this is a simple way: Also good is dd between the file system and /dev/null. Something worth remembering is that some tools (cp(1) in particular) use memory-mapped I/O, which may behave differently than raw I/O operations. Robert N M Watson Computer Laboratory University of Cambridge > > ---- > print "writing" > f = file("a_file", "w") > for x in xrange(1024): # write 1024 MB > f.write(' '*1024*1024) > f.close() > > raw_input("press enter to rewrite") > > print "rewriting" > f = file("a_file", "r+") > for x in xrange(1024): # write 1024 MB again > f.write(' '*1024*1024) > f.close() > ---- > > save it to a file, run the file with python interpreter. If you don't observe > the weird read-before-write effect, then it's not a problem in FreeBSD / NFS. > >