From patchwork Tue Feb 19 09:28:13 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sumit Garg X-Patchwork-Id: 158698 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp3447204jaa; Tue, 19 Feb 2019 01:29:19 -0800 (PST) X-Google-Smtp-Source: AHgI3IbluIl8HF5F3aBqoFu30IHtLJfZ3+W42XlqVm10lPb4AoXOz6OyWyHSeZseom+YFhRbVaf9 X-Received: by 2002:a50:8b26:: with SMTP id l35mr21713921edl.146.1550568559856; Tue, 19 Feb 2019 01:29:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550568559; cv=none; d=google.com; s=arc-20160816; b=Tuldpi8vcwxQuoHp0IIqE2474Z0AGIxQ2PIa1RlwYhl60iHSyFfL1QA03qRMB0nShV CzLxWKiXO8DglQBRGwi4L1JJpvCFu3iA2weC7fHyajLoLz0YIk4pzFuXf/fEfznLGF26 SBX074Aqqtya7RY9zVzN6V5uJiQrpYdeUEvf2e2e6g5ilWDiyDkLWaLmfQlJ7HluOoSB w/5ioAIrqJVSjUdxl5mdk259kCB8iKJslsSebq3aV9IA7sFkl8inU3Hk3hs6CM41pTjM 9q+NX9hkqYRgrdkbpdU5E5wT9JnhDJGA8MeZr/Ie3t7p86GPh+5gGfT5vKVEinHusgVZ I+Iw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:cc:message-id:date:to:from :dkim-signature:delivered-to; bh=ePUtT1Q+VoGfwMl1QlHYNUPRcq1xedrCt7OXhU8e/MI=; b=Q9I5jqnaFiJPFe1isiGcnwbvcpljbISKX1svSeDIdwCwwqvyJqknwVtVc7lDJYzLqq AoA3ZGlSpEqX3Ex9PVmfcnpF+BbBN0zPG2qcKoLwpuxENyL0XGoHGS4jADHgh1TQXjTP NSe7Hhe0VM8zput00imYFcHZDU9wWdmqm1NNwsMkseUt4saTY9zkQ7n9Iilif+aW54Vq XdyaIbKq+GBtZkAJJWulJAeylr2Df2iB2JwQfigqMMTZ8hLQFftHie2ptDtCPGXl3FSN oT6CObH/5/ry17zuZUutCSrjyaR8ozjkXk+/C3AHivmBGIKpuy9VhbJx9xh37Wu8sdAI Gjbg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=CRT9Nnfu; spf=pass (google.com: domain of ltp-bounces+patch=linaro.org@lists.linux.it designates 213.254.12.146 as permitted sender) smtp.mailfrom="ltp-bounces+patch=linaro.org@lists.linux.it"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from picard.linux.it (picard.linux.it. [213.254.12.146]) by mx.google.com with ESMTPS id i7si6119131edj.394.2019.02.19.01.29.19 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 19 Feb 2019 01:29:19 -0800 (PST) Received-SPF: pass (google.com: domain of ltp-bounces+patch=linaro.org@lists.linux.it designates 213.254.12.146 as permitted sender) client-ip=213.254.12.146; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=CRT9Nnfu; spf=pass (google.com: domain of ltp-bounces+patch=linaro.org@lists.linux.it designates 213.254.12.146 as permitted sender) smtp.mailfrom="ltp-bounces+patch=linaro.org@lists.linux.it"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from picard.linux.it (localhost [IPv6:::1]) by picard.linux.it (Postfix) with ESMTP id 6B0493EA37E for ; Tue, 19 Feb 2019 10:29:19 +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 [IPv6:2001:4b78:1:20::6]) by picard.linux.it (Postfix) with ESMTP id 6BB573EA37A for ; Tue, 19 Feb 2019 10:29:10 +0100 (CET) Received: from mail-pg1-x541.google.com (mail-pg1-x541.google.com [IPv6:2607:f8b0:4864:20::541]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by in-6.smtp.seeweb.it (Postfix) with ESMTPS id 0FF171400530 for ; Tue, 19 Feb 2019 10:29:02 +0100 (CET) Received: by mail-pg1-x541.google.com with SMTP id i130so9880133pgd.1 for ; Tue, 19 Feb 2019 01:29:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=mnrr/jgZRZ7Z9HH309o7XhgqkG43ze2RorlJ1YQtdVA=; b=CRT9Nnfuex0pZmV8Pb33pXzJeJ+ciuaKHnANKnBgkwbrK8Axrk2F71Q5Y9H0HF1x9t MOfYDiq6rvBz4mP92m1sNKO2OWTxRKxapoZ7z4f2DhLVOFkAnE/SjIfyyX2qvTer7Mhu QdAVmkad4UuGN7Js7X+DEquA03PPyeGEKGVjEr6fBOl+yKmjgaYdmB3BPeLQt3riYCZX fCoakUw/r18JDUVMrZacLGibuBFCHPHhbH2hC0ehyoOds65Euk9YY7x4yzvXV2LV5Gyn s8NlKIqtz7rgqRV1Vr9oLv44yR2b9RXBKw30zyTK9+xfEdXPeN980KnsTNDwYROyZZgB BAag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=mnrr/jgZRZ7Z9HH309o7XhgqkG43ze2RorlJ1YQtdVA=; b=DFnsxAdABZWdnbwX6GvzI23KdgMHB+jvS3Fgn+MzlVM2rJciBItKeY4KiW4YACBv0i teuwD53k3wMt8osXqqeVXhhPl2pcXpn28C7Z6g0MrhmplUgihKomZjNeKUYekVyAFVJo pZEBiP32/Yi17trvkKGPYELn9tAhS5gB4zd4ek7HPV1zsGwXb7O1RbzC6zpYxGt27ESF Ddq0OPx0ikhPHTr7fNX0DT62w18cQEjrGHlaGx8jG6wBYtkxpsMU8XCGGt1J41zBjKKf Yx3OyqOfxeT1Y8Fh6f8fOaPC/IPXC8FfM/gXy9eoZptVhWsnHqvBzndC4RdXq9cFQHgt a8DA== X-Gm-Message-State: AHQUAuZrvWHlfwQuITI+yyOuuXBmYfJVGhvREfkJpuIN1n9GcRLUr6qv gfEgvma4zjfRfuhTMKOQnEreQkpe2V4ZGQ== X-Received: by 2002:a63:1c02:: with SMTP id c2mr15900320pgc.351.1550568540029; Tue, 19 Feb 2019 01:29:00 -0800 (PST) Received: from localhost.localdomain ([117.252.69.94]) by smtp.gmail.com with ESMTPSA id n19sm34442229pfg.67.2019.02.19.01.28.56 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 19 Feb 2019 01:28:59 -0800 (PST) From: Sumit Garg To: ltp@lists.linux.it Date: Tue, 19 Feb 2019 14:58:13 +0530 Message-Id: <1550568500-10871-1-git-send-email-sumit.garg@linaro.org> X-Mailer: git-send-email 2.7.4 X-Virus-Scanned: clamav-milter 0.99.2 at in-6.smtp.seeweb.it X-Virus-Status: Clean X-Spam-Status: No, score=0.1 required=7.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,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 Cc: daniel.thompson@linaro.org Subject: [LTP] [PATCH v3 0/7] syscalls: add sync device test-cases X-BeenThere: ltp@lists.linux.it X-Mailman-Version: 2.1.18 Precedence: list List-Id: Linux Test Project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: ltp-bounces+patch=linaro.org@lists.linux.it Sender: "ltp" This patch-set adds common test for minimal sectors written on device for various sync related syscalls: 1. syncfs() 2. sync() 3. fsync() 4. fdatasync() 5. sync_file_range() Also this test is run on all supported filesystems on a test block device. Changes in v3: 1. Scope increased from single patch to this patch-set to add common test for sync(), fsync(), fdatasync() and sync_file_range() syscalls. 2. Move common functionality to library functions. 3. Use %lu rather than %s while parsing sectors written. 4. Add config check for C library wrapper and fallback definition for syncfs() and sync_file_range() syscalls. Changes in v2: 1. Remove unused header file include. 2. Remove redundant tst_device check. 3. Remove redundant flags from tst_test struct. Fixes: https://github.com/linux-test-project/ltp/issues/294 Sumit Garg (7): lib: Add library functions for sync related syscalls syscalls: add syncfs() sync device test-case syscalls/sync: add sync device test-case syscalls/fsync: add sync device test-case syscalls/fdatasync: add sync device test-case syscalls/sync_file_range: Use C library wrapper if present syscalls/sync_file_range: add sync device test-case configure.ac | 2 + include/lapi/sync_file_range.h | 64 +++++++++++++++++ include/lapi/syncfs.h | 21 ++++++ include/tst_sync_device.h | 17 +++++ include/tst_test.h | 7 ++ lib/tst_sync_device.c | 80 ++++++++++++++++++++++ m4/ltp-sync_file_range.m4 | 10 +++ m4/ltp-syncfs.m4 | 10 +++ runtest/syscalls | 6 ++ testcases/kernel/syscalls/fdatasync/.gitignore | 1 + testcases/kernel/syscalls/fdatasync/fdatasync03.c | 61 +++++++++++++++++ testcases/kernel/syscalls/fsync/.gitignore | 1 + testcases/kernel/syscalls/fsync/fsync04.c | 61 +++++++++++++++++ testcases/kernel/syscalls/sync/.gitignore | 1 + testcases/kernel/syscalls/sync/sync03.c | 59 ++++++++++++++++ .../kernel/syscalls/sync_file_range/.gitignore | 1 + .../sync_file_range/check_sync_file_range.h | 23 +++++++ .../syscalls/sync_file_range/sync_file_range01.c | 62 ++--------------- .../syscalls/sync_file_range/sync_file_range02.c | 70 +++++++++++++++++++ testcases/kernel/syscalls/syncfs/.gitignore | 1 + testcases/kernel/syscalls/syncfs/Makefile | 8 +++ testcases/kernel/syscalls/syncfs/check_syncfs.h | 19 +++++ testcases/kernel/syscalls/syncfs/syncfs01.c | 64 +++++++++++++++++ 23 files changed, 592 insertions(+), 57 deletions(-) create mode 100644 include/lapi/sync_file_range.h create mode 100644 include/lapi/syncfs.h create mode 100644 include/tst_sync_device.h create mode 100644 lib/tst_sync_device.c create mode 100644 m4/ltp-sync_file_range.m4 create mode 100644 m4/ltp-syncfs.m4 create mode 100644 testcases/kernel/syscalls/fdatasync/fdatasync03.c create mode 100644 testcases/kernel/syscalls/fsync/fsync04.c create mode 100644 testcases/kernel/syscalls/sync/sync03.c create mode 100644 testcases/kernel/syscalls/sync_file_range/check_sync_file_range.h create mode 100644 testcases/kernel/syscalls/sync_file_range/sync_file_range02.c create mode 100644 testcases/kernel/syscalls/syncfs/.gitignore create mode 100644 testcases/kernel/syscalls/syncfs/Makefile create mode 100644 testcases/kernel/syscalls/syncfs/check_syncfs.h create mode 100644 testcases/kernel/syscalls/syncfs/syncfs01.c