From owner-freebsd-fs@FreeBSD.ORG Tue Apr 16 11:50:19 2013 Return-Path: Delivered-To: freebsd-fs@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 57C1588E for ; Tue, 16 Apr 2013 11:50:19 +0000 (UTC) (envelope-from toasty@dragondata.com) Received: from mail-ie0-x22e.google.com (mail-ie0-x22e.google.com [IPv6:2607:f8b0:4001:c03::22e]) by mx1.freebsd.org (Postfix) with ESMTP id 26BCE5FB for ; Tue, 16 Apr 2013 11:50:19 +0000 (UTC) Received: by mail-ie0-f174.google.com with SMTP id 10so360260ied.5 for ; Tue, 16 Apr 2013 04:50:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dragondata.com; s=google; h=x-received:content-type:mime-version:subject:from:in-reply-to:date :cc:content-transfer-encoding:message-id:references:to:x-mailer; bh=w9nf0PvL5XAHn75U94Gtue8TkhN573QnevsLQZbduUs=; b=WGexmsIGEkEw43lhR6fhVkjPmxupkUozaHEGyjmxt4wbTAPARrBEGQ0m0c0nCgGLgI BHgcePMjOjaqVSSWUOGomkc5fDvVvheY31hUjQUMuiWetCNc0Xd2irCMM0MPcs5mSRAI x7CX1fKPKa5rlTkFq+f4TL845FMuApiwIpDk4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:content-type:mime-version:subject:from:in-reply-to:date :cc:content-transfer-encoding:message-id:references:to:x-mailer :x-gm-message-state; bh=w9nf0PvL5XAHn75U94Gtue8TkhN573QnevsLQZbduUs=; b=JrIFBbPQXFkd2vapJxXMlADaOvK5/Vg23O0XxT8MJISjB26K0PBL2C9SZWPtD3MMNx +YuCdVmM1cyzYpz1DiW/en2jCcVF5fm32U8psUhKbReOxAEqMsgCZVTncoGoweVLb4/f tCk6x+g2TiLYe1XcUdo8ja2rY4Td5EJ5sqP3HKeMK4d5Wif8w0Q0tjiiSpV/tMA4l5Ys Y3ePA3NRAg3QkXKb0dyHxUZDnxLpnkO2ngldvLLlPvKJ4ooexf2UXmQxEhB6O6lkyBCV TJNn0X8w8vRZiARkv+1B2QecIA3t3eB0XdjNZhV4nL2IWhK3jglIWqd7HK8mBHcGhz3S 8zaw== X-Received: by 10.50.77.110 with SMTP id r14mr1017932igw.85.1366113017804; Tue, 16 Apr 2013 04:50:17 -0700 (PDT) Received: from vpn132.rw1.your.org (vpn132.rw1.your.org. [204.9.51.132]) by mx.google.com with ESMTPS id ua6sm15157222igb.0.2013.04.16.04.50.15 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 16 Apr 2013 04:50:16 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 6.3 \(1503\)) Subject: Re: Does sync(8) really flush everything? Lost writes with journaled SU after sync+power cycle From: Kevin Day In-Reply-To: <20130411160253.V1041@besplex.bde.org> Date: Tue, 16 Apr 2013 06:50:13 -0500 Content-Transfer-Encoding: quoted-printable Message-Id: References: <87CC14D8-7DC6-481A-8F85-46629F6D2249@dragondata.com> <20130411160253.V1041@besplex.bde.org> To: Bruce Evans X-Mailer: Apple Mail (2.1503) X-Gm-Message-State: ALoCoQm4ncTb/06dkLrHUQi8miztqtF4RIy9vUKwtbyyUAnFaxfBbL3hLHF4Z4eLwXay8Z/65TIh Cc: "freebsd-fs@FreeBSD.org Filesystems" X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Apr 2013 11:50:19 -0000 On Apr 11, 2013, at 1:30 AM, Bruce Evans wrote: > sync(2) only schedules all writing of all modified buffers to disk. = Its > man page even says this. It doesn't wait for any of the writes to = complete. A very kind person has pointed out to me (off-list) that doing: mount -u -o ro / (without -f) causes mount to force a flush, waits for completion, THEN bails out = because there are open files preventing the read-only downgrade. We've = been testing this here and it seems to be a usable workaround. I'm also pointing out for at least our purposes, this problem (sync(2) = doesn't seem to actually cause any writes) only seems to be causing lost = directories if I'm using journaling. I'm attempting to narrow down why = journaling appears to make sync into a no-op.=20 -- Kevin