From patchwork Thu Feb 21 09:00:07 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sumit Garg X-Patchwork-Id: 158878 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp242624jaa; Thu, 21 Feb 2019 01:01:00 -0800 (PST) X-Google-Smtp-Source: AHgI3IaKQuTRubasqibToLwTlceY8tjraMoQj7WOp/wOUOjOWZeune+EtSL5MvCShdDg1VFcU+9/ X-Received: by 2002:a50:ad4b:: with SMTP id z11mr29895601edc.157.1550739660730; Thu, 21 Feb 2019 01:01:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550739660; cv=none; d=google.com; s=arc-20160816; b=pLlB8y/TqsbvDB6R5I7+VleOZqypObfrBYVr1a3bCVh4dsKYw/6lMFI1hYW4OqL/zM FjUkiZfDZHnN8TD3O72WlZh6G268FulCAxdAgFTWU/Q/jP8o0OvdA7Kenpw3+dxkPhPN 4TgbC/uJ1IN5577LjKP2DhLzRpRJuK1V+j0efVQ/9XHqEbAggidXcf1BE7W5Bmey1T9b uQNGiGnRRQVqVeEKbzSb1yvVPdKM1uTF2J6iZC1owM6qb47d8p7zJU/msBraB2R4/r/I gznm8XfuIVUriqE7K/Dw3IdxfTCKlm5NSp4O4w33OGM4QzYnCfAdQrm/5T4DYQZadKPe q6FA== 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=vWICdZC6WsXh+Xtl9rG1Os+4u5wsfSOOYdPrme7oixg=; b=kAuwgVXVEImCh6sUQjipn88BAJCX/FoFZy4mx+J3oHINMDfEVOw2hJH+2/YIzkhdFP a8DQUXcMzT7LHjrhtnL75pa9fRbtxIndQvd5dKNcMub1uGKW6mDV9An+tLcpBf9Iqt/Y eAkpV5EemQ2t8rWB2VeB+cSVLc6UwW6ZpHx87AcRuMsDXQ7CaVMUvjw23RYQamgM7Ptl Z4luce4X9Bsbch65ugdIW5f8v39hzbG5zBWA1ir4z0dgv7A5JYITYV0Vzpw1QjlCseTe gU3VMEdub17oLzUDSuhZWLAgVtEQqEAYF9unG5jMx+lVsinog5Jxt9csI3+yGmKUVLgL rqUw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=CEwbEq5W; spf=pass (google.com: domain of ltp-bounces+patch=linaro.org@lists.linux.it designates 2001:1418:10:5::2 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. [2001:1418:10:5::2]) by mx.google.com with ESMTPS id cj22si4815747ejb.206.2019.02.21.01.01.00 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 21 Feb 2019 01:01:00 -0800 (PST) Received-SPF: pass (google.com: domain of ltp-bounces+patch=linaro.org@lists.linux.it designates 2001:1418:10:5::2 as permitted sender) client-ip=2001:1418:10:5::2; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=CEwbEq5W; spf=pass (google.com: domain of ltp-bounces+patch=linaro.org@lists.linux.it designates 2001:1418:10:5::2 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 507D13EA296 for ; Thu, 21 Feb 2019 10:01:00 +0100 (CET) X-Original-To: ltp@lists.linux.it Delivered-To: ltp@picard.linux.it Received: from in-2.smtp.seeweb.it (in-2.smtp.seeweb.it [IPv6:2001:4b78:1:20::2]) by picard.linux.it (Postfix) with ESMTP id 7733C3EA20B for ; Thu, 21 Feb 2019 10:00:54 +0100 (CET) Received: from mail-pf1-x441.google.com (mail-pf1-x441.google.com [IPv6:2607:f8b0:4864:20::441]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by in-2.smtp.seeweb.it (Postfix) with ESMTPS id 1A63F6018AD for ; Thu, 21 Feb 2019 10:00:46 +0100 (CET) Received: by mail-pf1-x441.google.com with SMTP id n125so6153963pfn.5 for ; Thu, 21 Feb 2019 01:00:45 -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=aHMO1MKWgkAINnVMLkbjBsTyWr8f1HUNeJZL/v3v5FM=; b=CEwbEq5WrqJYEfwgHN3yw1yBXHRzA41QuB+UjqZ650++c/f1F5MxFRhsLudVPHb5uY PSBhE2TSs0oVHo/EBoQ+ND7YrKgMt60sE2J6kc6H4XjKksBFPV4aH6jXbiSIolDM6Rro nMt1HuHM6qmvz3sdWQyR+jQVh9ZXwjE+LFecVUROnI+qW3s0hopOhVVl6Jrh5bezuHZ/ SyT60ac4pZniMKnbAFQnyfT+kxehTKyXjeNJ3PvioiwwmTDrRcVFwVlX82pt2o7gnANH sxvSat5LBEC9AAW/yq0yhlvEs9Pe6xqISh5y7O/FJ1kEaKUVXDLHgSpdHrXfvQQyGuP3 wO0w== 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=aHMO1MKWgkAINnVMLkbjBsTyWr8f1HUNeJZL/v3v5FM=; b=F3Mu2NZxvPPA6lUE73/U6scVEfYqWkIBPUiFO7LuPsc4S0FkKHjPzVHjxZvCYlD1ob xiyJtLJs3ZblSV9m7jRHsbhkmcTre6087/e2mLzXqxfWaoV8dRW8FeB/kRGggq5jrzPo oPuZGMqfVZiP0XTp4L5KIOCIghwWJGpnMDf2/pDHEGWBvBX6QJzMbRTEPmeSjqcFrsoy +ViBU7PMfRf0u7Z9MoEfiZ68++raBvlyGBAyNH7ycJBS7T0aB14lHszD811YG3BO9mmk xH7+dqLUo6TNPoSSwy2cR36Z5qBWqrGLb93JaKQ/lrl3mweXXEnrqqUvg5GzkvHK6bzF XT1A== X-Gm-Message-State: AHQUAuYwOVmRXdaVMh45t3RGynsCOQJVydZ5t+pb4CQAg5Fztye73jA1 dnHyPE0u03OABGI0/u9Q2MrDjA== X-Received: by 2002:a63:1616:: with SMTP id w22mr32954185pgl.200.1550739644170; Thu, 21 Feb 2019 01:00:44 -0800 (PST) Received: from localhost.localdomain ([117.252.69.94]) by smtp.gmail.com with ESMTPSA id v4sm27703948pff.77.2019.02.21.01.00.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 21 Feb 2019 01:00:43 -0800 (PST) From: Sumit Garg To: chrubis@suse.cz, ltp@lists.linux.it Date: Thu, 21 Feb 2019 14:30:07 +0530 Message-Id: <1550739616-24054-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-2.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-2.smtp.seeweb.it Cc: daniel.thompson@linaro.org Subject: [LTP] [PATCH v4 0/9] 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 v4: 1. Update common library functions from reusability perspective. 2. Create separate patch for TEST_VOID macro. 3. Add check for broken /sys/block//stat file. 4. Miscellaneous fixups. 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 (9): lib/tst_device: add new api tst_dev_bytes_written() lib: split tst_fill_file() to create new tst_fill_fd() lib/tst_test: define TEST_VOID() macro 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 | 57 +++++++++++++++++ include/lapi/syncfs.h | 21 +++++++ include/tst_device.h | 7 +++ include/tst_fs.h | 9 +++ include/tst_test.h | 7 +++ lib/tst_device.c | 29 +++++++++ lib/tst_fill_file.c | 40 +++++++----- 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 | 60 ++++++++++++++++++ testcases/kernel/syscalls/fsync/.gitignore | 1 + testcases/kernel/syscalls/fsync/fsync04.c | 60 ++++++++++++++++++ testcases/kernel/syscalls/sync/.gitignore | 1 + testcases/kernel/syscalls/sync/sync03.c | 60 ++++++++++++++++++ .../kernel/syscalls/sync_file_range/.gitignore | 1 + .../sync_file_range/check_sync_file_range.h | 21 +++++++ .../syscalls/sync_file_range/sync_file_range01.c | 62 ++----------------- .../syscalls/sync_file_range/sync_file_range02.c | 72 ++++++++++++++++++++++ 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 | 67 ++++++++++++++++++++ 25 files changed, 558 insertions(+), 74 deletions(-) create mode 100644 include/lapi/sync_file_range.h create mode 100644 include/lapi/syncfs.h 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