From 7c1e53314443ba5d1d42e3096f386a828a9bd4fa Mon Sep 17 00:00:00 2001 From: David Bremner Date: Thu, 8 May 2014 20:57:07 +0900 Subject: [PATCH] [PATCH] notmuch-dump: use fsync instead of fdatasync --- 6a/d0d5dc7abf228d557779010b4f19b853b3e843 | 71 +++++++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 6a/d0d5dc7abf228d557779010b4f19b853b3e843 diff --git a/6a/d0d5dc7abf228d557779010b4f19b853b3e843 b/6a/d0d5dc7abf228d557779010b4f19b853b3e843 new file mode 100644 index 000000000..44f140d51 --- /dev/null +++ b/6a/d0d5dc7abf228d557779010b4f19b853b3e843 @@ -0,0 +1,71 @@ +Return-Path: +X-Original-To: notmuch@notmuchmail.org +Delivered-To: notmuch@notmuchmail.org +Received: from localhost (localhost [127.0.0.1]) + by olra.theworths.org (Postfix) with ESMTP id DEA48431FBF + for ; Thu, 8 May 2014 04:58:20 -0700 (PDT) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: 0 +X-Spam-Level: +X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none] + autolearn=disabled +Received: from olra.theworths.org ([127.0.0.1]) + by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) + with ESMTP id bg+ivVVaCJJY for ; + Thu, 8 May 2014 04:58:16 -0700 (PDT) +Received: from mx.xen14.node3324.gplhost.com (gitolite.debian.net + [87.98.215.224]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) + (No client certificate requested) + by olra.theworths.org (Postfix) with ESMTPS id 0D020431FAE + for ; Thu, 8 May 2014 04:58:16 -0700 (PDT) +Received: from remotemail by mx.xen14.node3324.gplhost.com with local (Exim + 4.72) (envelope-from ) + id 1WiMx8-00070g-CL; Thu, 08 May 2014 11:57:30 +0000 +Received: (nullmailer pid 18544 invoked by uid 1000); Thu, 08 May 2014 + 11:57:12 -0000 +From: David Bremner +To: notmuch@notmuchmail.org +Subject: [PATCH] notmuch-dump: use fsync instead of fdatasync +Date: Thu, 8 May 2014 20:57:07 +0900 +Message-Id: <1399550227-18488-1-git-send-email-david@tethera.net> +X-Mailer: git-send-email 1.9.2 +In-Reply-To: <20140507171835.GA27619@mit.edu> +References: <20140507171835.GA27619@mit.edu> +X-BeenThere: notmuch@notmuchmail.org +X-Mailman-Version: 2.1.13 +Precedence: list +List-Id: "Use and development of the notmuch mail system." + +List-Unsubscribe: , + +List-Archive: +List-Post: +List-Help: +List-Subscribe: , + +X-List-Received-Date: Thu, 08 May 2014 11:58:21 -0000 + +Since the file size will have changed, there is no performance benefit +to calling fdatasync. Somewhat surprisingly, using fdatasync +apparently causes portability problems on FreeBSD. +--- + notmuch-dump.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/notmuch-dump.c b/notmuch-dump.c +index 2849eab..887a208 100644 +--- a/notmuch-dump.c ++++ b/notmuch-dump.c +@@ -169,7 +169,7 @@ notmuch_database_dump (notmuch_database_t *notmuch, + } + + if (output_file_name) { +- ret = fdatasync (outfd); ++ ret = fsync (outfd); + if (ret) { + fprintf (stderr, "Error syncing %s to disk: %s\n", + name_for_error, strerror (errno)); +-- +1.9.2 + -- 2.26.2