From patchwork Wed Jun 7 13:31:14 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Kara X-Patchwork-Id: 772428 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3wjTwb3bgvz9s7v for ; Wed, 7 Jun 2017 23:31:27 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751564AbdFGNbW (ORCPT ); Wed, 7 Jun 2017 09:31:22 -0400 Received: from mx2.suse.de ([195.135.220.15]:50831 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751470AbdFGNbW (ORCPT ); Wed, 7 Jun 2017 09:31:22 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 1B1A4AAC5; Wed, 7 Jun 2017 13:31:21 +0000 (UTC) Received: by quack2.suse.cz (Postfix, from userid 1000) id B3E7F1E34E2; Wed, 7 Jun 2017 15:31:20 +0200 (CEST) From: Jan Kara To: Ted Tso Cc: , Jan Kara Subject: [PATCH] libext2fs: Fix fsync(2) detection Date: Wed, 7 Jun 2017 15:31:14 +0200 Message-Id: <20170607133114.27799-1-jack@suse.cz> X-Mailer: git-send-email 2.12.3 Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org For some reason lib/config.h.in was missing a definition of HAVE_FSYNC and as a result lib/config.h never had HAVE_FSYNC defined. As a result we never called fsync(2) for example from lib/ext2fs/unix_io.c:unix_flush() when we finished creating filesystem and could miss IO errors happening during creating of the filesystem. Test generic/405 exposes this problem. Fix the problem by defining HAVE_FSYNC in lib/config.h.in. Signed-off-by: Jan Kara --- lib/config.h.in | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/config.h.in b/lib/config.h.in index 37d0c461338a..91e869e7d3d7 100644 --- a/lib/config.h.in +++ b/lib/config.h.in @@ -470,6 +470,9 @@ /* Define to 1 if you have the `sync_file_range' function. */ #undef HAVE_SYNC_FILE_RANGE +/* Define to 1 if you have the 'fsync' function. */ +#undef HAVE_FSYNC + /* Define to 1 if you have the `sysconf' function. */ #undef HAVE_SYSCONF