[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <868f8fb6-6024-d60d-a9aa-6513b9d0986f@deltatee.com>
Date: Tue, 6 Oct 2020 17:59:35 -0600
From: Logan Gunthorpe <logang@...tatee.com>
To: Chaitanya Kulkarni <Chaitanya.Kulkarni@....com>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"linux-nvme@...ts.infradead.org" <linux-nvme@...ts.infradead.org>,
"linux-block@...r.kernel.org" <linux-block@...r.kernel.org>,
Omar Sandoval <osandov@...ndov.com>
Cc: Sagi Grimberg <sagi@...mberg.me>,
Stephen Bates <sbates@...thlin.com>
Subject: Re: [PATCH blktests v2 03/11] common/xfs: Create common helper to
verify block device with xfs
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 <logang@...tatee.com>
>> ---
>> 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
Powered by blists - more mailing lists