From owner-freebsd-questions@FreeBSD.ORG Fri Jul 22 14:50:52 2011 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 18F6A1065675 for ; Fri, 22 Jul 2011 14:50:52 +0000 (UTC) (envelope-from kudzu@tenebras.com) Received: from mail-gw0-f54.google.com (mail-gw0-f54.google.com [74.125.83.54]) by mx1.freebsd.org (Postfix) with ESMTP id D396A8FC13 for ; Fri, 22 Jul 2011 14:50:51 +0000 (UTC) Received: by gwb15 with SMTP id 15so1944453gwb.13 for ; Fri, 22 Jul 2011 07:50:51 -0700 (PDT) MIME-Version: 1.0 Received: by 10.236.143.71 with SMTP id k47mr2151199yhj.30.1311346251013; Fri, 22 Jul 2011 07:50:51 -0700 (PDT) Received: by 10.236.61.39 with HTTP; Fri, 22 Jul 2011 07:50:50 -0700 (PDT) In-Reply-To: <20110722164254.4d4c1093.freebsd@edvax.de> References: <201107221337.15804.pieter@degoeje.nl> <1311340592.24555.YahooMailClassic@web160109.mail.bf1.yahoo.com> <20110722164254.4d4c1093.freebsd@edvax.de> Date: Fri, 22 Jul 2011 07:50:50 -0700 Message-ID: From: Michael Sierchio To: Polytropon Content-Type: text/plain; charset=ISO-8859-1 Cc: freebsd-questions@freebsd.org Subject: Re: How to sync a file on FreeBSD? [SOLVED] X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Jul 2011 14:50:52 -0000 On Fri, Jul 22, 2011 at 7:42 AM, Polytropon wrote: > But wouldn't sync() (see "man 2 sync") make sure that > all buffers, even in regards to soft updates, get > immediately flushed / written? Apparently not. I think most of Matt Dillon's notes are still relevant. http://leaf.dragonflybsd.org/mailarchive/kernel/2010-01/msg00005.html >> In order to >> implement a stable queue, it would be best to use a different >> filesystem. > > What type of filesystem would match those requirements? I would make a UFS filesystem without Softupdates enabled, use fflush() and wait for a proper ack before promising to the caller that the bits will survive something like pulling the plug. Softupdates guarantees metadata consistency. I would probably make decisions about block and fragment sizes based on knowledge of the physical device's buffer mechanism, sector sizes, etc.