From patchwork Mon Jan 20 10:54:41 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Petr Vorel X-Patchwork-Id: 1225869 X-Patchwork-Delegate: petr.vorel@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.linux.it (client-ip=213.254.12.146; helo=picard.linux.it; envelope-from=ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=suse.cz Received: from picard.linux.it (picard.linux.it [213.254.12.146]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 481T8R2PsMz9sRk for ; Mon, 20 Jan 2020 21:55:03 +1100 (AEDT) Received: from picard.linux.it (localhost [IPv6:::1]) by picard.linux.it (Postfix) with ESMTP id 559EC3C2334 for ; Mon, 20 Jan 2020 11:55:00 +0100 (CET) X-Original-To: ltp@lists.linux.it Delivered-To: ltp@picard.linux.it Received: from in-6.smtp.seeweb.it (in-6.smtp.seeweb.it [217.194.8.6]) by picard.linux.it (Postfix) with ESMTP id 85C673C2259 for ; Mon, 20 Jan 2020 11:54:55 +0100 (CET) Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by in-6.smtp.seeweb.it (Postfix) with ESMTPS id CEF6114016B7 for ; Mon, 20 Jan 2020 11:54:54 +0100 (CET) Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id E5FCCAB98; Mon, 20 Jan 2020 10:54:53 +0000 (UTC) From: Petr Vorel To: ltp@lists.linux.it Date: Mon, 20 Jan 2020 11:54:41 +0100 Message-Id: <20200120105441.19418-1-pvorel@suse.cz> X-Mailer: git-send-email 2.24.1 MIME-Version: 1.0 X-Virus-Scanned: clamav-milter 0.99.2 at in-6.smtp.seeweb.it X-Virus-Status: Clean X-Spam-Status: No, score=0.0 required=7.0 tests=SPF_HELO_NONE,SPF_PASS autolearn=disabled version=3.4.0 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on in-6.smtp.seeweb.it Subject: [LTP] [PATCH 1/1] tst_device.h: Use and fallback to sync() X-BeenThere: ltp@lists.linux.it X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux Test Project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it Sender: "ltp" This partly reverts commit 9e83513eb, which unconditionally included lapi/syscalls.h. Put back and fallback to sync() for these rare cases where __NR_syncfs. Hope this is final fix for syncfs() issues. Fixes: 9e83513eb "tst_device.h: Use lapi/syscalls.h instead of " Signed-off-by: Petr Vorel --- include/tst_device.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/include/tst_device.h b/include/tst_device.h index 13d92ee54..1456cb2ff 100644 --- a/include/tst_device.h +++ b/include/tst_device.h @@ -19,7 +19,7 @@ #define TST_DEVICE_H__ #include -#include "lapi/syscalls.h" +#include struct tst_device { const char *dev; @@ -78,7 +78,12 @@ int tst_detach_device(const char *dev_path); */ static inline int tst_dev_sync(int fd) { +#ifdef __NR_syncfs return syscall(__NR_syncfs, fd); +#else + sync(); + return 0; +#endif } /*