Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp42103pxu; Tue, 6 Oct 2020 18:08:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx13OQ8qktE7ZuaR5aWgx0XDTTqjMDs3tULcic4D57P7TuWCxMPmL6ACg+PC4e2+x7tJbiO X-Received: by 2002:a17:906:6409:: with SMTP id d9mr790372ejm.344.1602032918894; Tue, 06 Oct 2020 18:08:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602032918; cv=none; d=google.com; s=arc-20160816; b=UxMAR9XHC08xhgjZrv5XXypsDmOpSwxUZHH7fHbWD8hXSQQ3mSRaIU76hF96qREZ9a PDZrS2TU7R9vNi/G0jWliGTszOubfOtrNfr/D1/lOwLoDH8KoGACHiNS/v4jwcBnosxo aUKLIbPkzhIOd+vdPIp+FNB30i0EraaA/Q9Pd1abZUHFFykhsgAS9V68C3E2NeAuyL1/ AOLjpcU/f6UT2q/FqQHwfMC0769OjJigiKsae0XyBNQ2E/y26y5XjLM5Tb/HKUME3PDW 8enJYIuqMXOyVYyAIQGcrHpPthGGGG4Bo6XTg3W7vncbur/ZId9+buHcg55mDnj0U2pu f8Fw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:subject:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:dkim-signature; bh=JHj9CUDHulvt/1dca/0kn+WWXEkB7eaUTv3vf/yi1ks=; b=NyY8HywnvrXcmoqYosmlh3eto0rKz+dEt5LQOlGSPqiXVp88fx3yF9IHutFumDZKcv rU4K66uDYIsOg/K3itKmGo5ZcJIZoBesPP+vtkgTCDaapN4kvqPDx+BsMOrJuwst7yFK 5yoRyg73a3YJN2NcoOj6l4X83A0OnhykDlyiStwuTTdT7Yf04H7h04tpM7tyeatUsOWw qW5hV6vuKnt3EC8UlD+GqPXrnhcPbJAHb58gebWYB9bTlSvLLAJCu2R+HmG2z/HADs6y C/XNt7dgbWw2II3/yiksG4Et03a7HsCxPDwdeQgzoh2PpMX0DomGteL7ozb+xSPSzhOv 2oCg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@deltatee.com header.s=20200525 header.b=lcHTIxtP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e13si291530edu.27.2020.10.06.18.08.15; Tue, 06 Oct 2020 18:08:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=fail header.i=@deltatee.com header.s=20200525 header.b=lcHTIxtP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726561AbgJFX7j (ORCPT + 99 others); Tue, 6 Oct 2020 19:59:39 -0400 Received: from ale.deltatee.com ([204.191.154.188]:32836 "EHLO ale.deltatee.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725925AbgJFX7i (ORCPT ); Tue, 6 Oct 2020 19:59:38 -0400 X-Greylist: delayed 486 seconds by postgrey-1.27 at vger.kernel.org; Tue, 06 Oct 2020 19:59:38 EDT DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=deltatee.com; s=20200525; h=Subject:Content-Transfer-Encoding:Content-Type: In-Reply-To:MIME-Version:Date:Message-ID:From:References:Cc:To:Sender: Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender :Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=JHj9CUDHulvt/1dca/0kn+WWXEkB7eaUTv3vf/yi1ks=; b=lcHTIxtPiDHBVgECn9AZ9Qt3Bo +IofrW10Um/Kg01wz9y25FjxYCE8gRn4GlMmNOo5wVVPdwXHMkFK8spdCeo88gqG0Xe82CXFHrPeM ix4Y/+aIrHEINluE1m28LkxabWg+T4QlSU4fo9g9GHMa7MdkZcE2xlVuwew0wniUVg3gEibPXBK1q jk9Oh4SN3Ghsuxrfhn7fCFb4THtoTkvUcIXzrw3Y296YAJl34KCVx1wWN7ThodL063S8nMpW/jsuR HP11CkGzipf3VxAkBNdosKYbdoPX8uHqanmmSEATaDCKS/bQCLtOLEqP9EEsqd9zdV4zmexir0Dym h5oZM4UA==; Received: from [172.16.1.162] by ale.deltatee.com with esmtp (Exim 4.92) (envelope-from ) id 1kPwro-0006k3-2h; Tue, 06 Oct 2020 17:59:36 -0600 To: Chaitanya Kulkarni , "linux-kernel@vger.kernel.org" , "linux-nvme@lists.infradead.org" , "linux-block@vger.kernel.org" , Omar Sandoval Cc: Sagi Grimberg , Stephen Bates References: <20200930185422.11494-1-logang@deltatee.com> <20200930185422.11494-4-logang@deltatee.com> From: Logan Gunthorpe Message-ID: <868f8fb6-6024-d60d-a9aa-6513b9d0986f@deltatee.com> Date: Tue, 6 Oct 2020 17:59:35 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.12.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-CA Content-Transfer-Encoding: 7bit X-SA-Exim-Connect-IP: 172.16.1.162 X-SA-Exim-Rcpt-To: sbates@raithlin.com, sagi@grimberg.me, osandov@osandov.com, linux-block@vger.kernel.org, linux-nvme@lists.infradead.org, linux-kernel@vger.kernel.org, Chaitanya.Kulkarni@wdc.com X-SA-Exim-Mail-From: logang@deltatee.com X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on ale.deltatee.com X-Spam-Level: X-Spam-Status: No, score=-6.9 required=5.0 tests=ALL_TRUSTED,BAYES_00, NICE_REPLY_A autolearn=ham autolearn_force=no version=3.4.2 Subject: Re: [PATCH blktests v2 03/11] common/xfs: Create common helper to verify block device with xfs X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on ale.deltatee.com) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2020-10-06 5:50 p.m., Chaitanya Kulkarni wrote: > On 9/30/20 11:54, Logan Gunthorpe wrote: >> Make a common helper from the code in tests nvme/012 and nvme/013 >> to run an fio verify on a XFS file system backed by the >> specified block device. >> >> While we are at it, all the output is redirected to $FULL instead of >> /dev/null. >> >> Signed-off-by: Logan Gunthorpe >> --- >> common/xfs | 22 ++++++++++++++++++++++ >> tests/nvme/012 | 14 +------------- >> tests/nvme/013 | 14 +------------- >> 3 files changed, 24 insertions(+), 26 deletions(-) > > The common namespace is getting cluttered. Can you please create > > a subdirectory common/fs/xfs ? I disagree. The common directory only has 9 files. And given there appear to be no other files to add to the fs directory I don't think now is the time to create a directory. We can do so if and when a number of other fs helpers show up and there's a reason to group them together. >> >> diff --git a/common/xfs b/common/xfs >> index d1a603b8c7b5..210c924cdd41 100644 >> --- a/common/xfs >> +++ b/common/xfs >> @@ -9,3 +9,25 @@ >> _have_xfs() { >> _have_fs xfs && _have_program mkfs.xfs >> } >> + >> +_xfs_mkfs_and_mount() { >> + local bdev=$1 >> + local mount_dir=$2 >> + >> + mkdir -p "${mount_dir}" >> + umount "${mount_dir}" >> + mkfs.xfs -l size=32m -f "${bdev}" >> + mount "${bdev}" "${mount_dir}" >> +} >> + >> +_xfs_run_fio_verify_io() { >> + local mount_dir="/mnt/blktests" > > The mount dir should be a parameter and not the hardcode value > to make it reusable. I also disagree here. It is already reusable and is used in a number of places; none of those places require changing the mount directory. If and when a use comes up that requires a different directory (not sure what that would be), a parameter can be added. It is typically standard practice in the Linux community to not add features that have no users as it's confusing to people reading the code. Logan