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: 1044563 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=lists.linux.it (client-ip=2001:1418:10:5::2; helo=picard.linux.it; envelope-from=ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="CRT9Nnfu"; dkim-atps=neutral Received: from picard.linux.it (picard.linux.it [IPv6:2001:1418:10:5::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 443b682HwJz9rxp for ; Tue, 19 Feb 2019 20:29:19 +1100 (AEDT) Received: from picard.linux.it (localhost [IPv6:::1]) by picard.linux.it (Postfix) with ESMTP id 3E4473EA3BC for ; Tue, 19 Feb 2019 10:29:17 +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-Google-Smtp-Source: AHgI3Ibn3myNGy4LG5B7OGmvyjSa1Fqp859xOKt3RMlDX/giTxtFwVO6/QPr8+7WbUJwL7TFUhFL1Q== 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+incoming=patchwork.ozlabs.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