From owner-freebsd-fs@FreeBSD.ORG Mon Jan 24 15:34:19 2011 Return-Path: Delivered-To: freebsd-fs@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D4841106564A for ; Mon, 24 Jan 2011 15:34:19 +0000 (UTC) (envelope-from numisemis@gmail.com) Received: from mail-ey0-f182.google.com (mail-ey0-f182.google.com [209.85.215.182]) by mx1.freebsd.org (Postfix) with ESMTP id 636F38FC18 for ; Mon, 24 Jan 2011 15:34:18 +0000 (UTC) Received: by eyf6 with SMTP id 6so1937411eyf.13 for ; Mon, 24 Jan 2011 07:34:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:content-type; bh=BWbLHNCvNsFxf9QO9BiE95b9TWkwa7JHPC2gGWdZrkM=; b=BfAuaVz4YKM8FsZQ1BGts8VyBtwLBNsvHRem2foH/O1PB1mULy8/29dmkTi7LhkWUy JXRUj8u533l99lZCrTKoB6jHmq6HY01kiyf6Zfj0AGAHjocqbcs2l3Wsl4/oCgVYwtUt zBr4/QdMVD8dSsjncuLNiDubwOIHFzHdntqgI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=AhYJu+RDSXR+EBqgp4akqKaJmhqzHNellhmoo18r+xHfcHi8wybNLIZrCUsU/Mlvna EDm9hLnj+6DAh0km49ruiIHP0shQ4Z+nTrgg6+ZShDs1i9Dr7B8mAtxevelhjPuafhSO cg5DgT+BxtzQPCdykqMmyEdZ24fkzYneqfd3E= MIME-Version: 1.0 Received: by 10.213.31.146 with SMTP id y18mr4944442ebc.99.1295881750987; Mon, 24 Jan 2011 07:09:10 -0800 (PST) Received: by 10.213.112.141 with HTTP; Mon, 24 Jan 2011 07:09:10 -0800 (PST) In-Reply-To: <20110124144236.GA19500@icarus.home.lan> References: <1ABA88EDF84B6472579216FE@Octa64> <20110122111045.GA59117@icarus.home.lan> <20110124144236.GA19500@icarus.home.lan> Date: Mon, 24 Jan 2011 16:09:10 +0100 Message-ID: From: =?ISO-8859-2?Q?=A9imun_Mikecin?= To: Jeremy Chadwick , freebsd-fs@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: Subject: Re: Write cache, is write cache, is write cache? X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Jan 2011 15:34:19 -0000 2011/1/24 Jeremy Chadwick > The term "flush" means many different things. fsync(2), for example, > behaves differently on UFS than it does on ZFS. People think that > "flush" means "guarantee the data written was written to disk", but > ensuring an actual ATA/SCSI command completes **and** has had its data > written to the platters is an entirely different beast (IMO) than "flush > kernel buffers to disk and hope for the best". > AFAIK, BIO_FLUSH should complete when data was written to disk (not before), or in the case of battery backed cache: when data was written to battery backed cache. AFAIK, ZFS doesn't only "flush kernel buffers" (like UFS does), but also executes BIO_FLUSH every X seconds (X=5 if my memory serves me well). So, you shouldn't loose data that was written before BIO_FLUSH executed. With single disks, all I've seen are read/write errors which can't be > repaired. "zpool status" will actually show what files got affected as > a result of the issue, though sometimes "zpool scrub" needs to be run > before this can be detected. Adding redudancy does make your data safer, but if everything is working as explained, sudden power-loss shouldn't be the cause of those errors even with single disks. Correct me if you think that I'm mistaken.