From: Anand Jain <anand.jain@oracle.com>
To: Filipe Manana <fdmanana@kernel.org>
Cc: fstests@vger.kernel.org, linux-btrfs@vger.kernel.org, zlang@redhat.com
Subject: Re: [PATCH v2 07/10] btrfs: introduce helper for creating cloned devices with mkfs
Date: Fri, 23 Feb 2024 23:14:23 +0530 [thread overview]
Message-ID: <a5a0042e-a8c8-4e29-a752-fb1b49db5584@oracle.com> (raw)
In-Reply-To: <CAL3q7H4xx6Jnee2vnLqdKhiJier2EfcuidA2q9QhyTYPB2LAsw@mail.gmail.com>
On 2/20/24 22:21, Filipe Manana wrote:
> On Mon, Feb 19, 2024 at 7:49 PM Anand Jain <anand.jain@oracle.com> wrote:
>>
>> Use newer mkfs.btrfs option to generate two cloned devices,
>> used in test cases.
>>
>> Signed-off-by: Anand Jain <anand.jain@oracle.com>
>> ---
>> v2:
>> Organize changes to its right patch.
>> Fix _fail erorr message.
>> Declare local variables for fsid and uuid.
>>
>> common/btrfs | 21 +++++++++++++++++++++
>> 1 file changed, 21 insertions(+)
>>
>> diff --git a/common/btrfs b/common/btrfs
>> index f694afac3d13..c3e5827562d6 100644
>> --- a/common/btrfs
>> +++ b/common/btrfs
>> @@ -838,3 +838,24 @@ check_fsid()
>> echo -e -n "Tempfsid status:\t"
>> cat /sys/fs/btrfs/$tempfsid/temp_fsid
>> }
>> +
>> +mkfs_clone()
>> +{
>> + local fsid
>> + local uuid
>> + local dev1=$1
>> + local dev2=$2
>> +
>> + [[ -z $dev1 || -z $dev2 ]] && \
>> + _fail "mkfs_clone requires two devices as arguments"
>> +
>> + _mkfs_dev -fq $dev1
>> +
>> + fsid=$($BTRFS_UTIL_PROG inspect-internal dump-super $dev1 | \
>> + grep -E ^fsid | $AWK_PROG '{print $2}')
>> + uuid=$($BTRFS_UTIL_PROG inspect-internal dump-super $dev1 | \
>> + grep -E ^dev_item.uuid | $AWK_PROG '{print $2}')
>> +
>> + _mkfs_dev -fq --uuid $fsid --device-uuid $uuid $dev2
>
> So this function should call:
>
> _require_btrfs_command inspect-internal dump-super
> _require_btrfs_mkfs_uuid_option
>
Added these two perreq to the helper function.
> Instead of having all the test cases that use it to do those calls, as
> mentioned in a previous patch.
>
>> +}
>> +>>>>>>> e22bb3c816c1 (btrfs: introduce helper for creating cloned devices with mkfs)
>
> This isn't supposed to be here...
Oops. Now removed.
Thanks for the review.
-Anand
>
> Thanks.
>
>> --
>> 2.39.3
>>
next prev parent reply other threads:[~2024-02-23 17:44 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-19 19:48 [PATCH v2 00/10] btrfs: functional test cases for tempfsid Anand Jain
2024-02-19 19:48 ` [PATCH v2 01/10] assign SCRATCH_DEV_POOL to an array Anand Jain
2024-02-20 16:17 ` Filipe Manana
2024-02-19 19:48 ` [PATCH v2 02/10] btrfs: introduce tempfsid test group Anand Jain
2024-02-19 19:48 ` [PATCH v2 03/10] btrfs: create a helper function, check_fsid(), to verify the tempfsid Anand Jain
2024-02-20 16:24 ` Filipe Manana
2024-02-19 19:48 ` [PATCH v2 04/10] btrfs: verify that subvolume mounts are unaffected by tempfsid Anand Jain
2024-02-20 16:30 ` Filipe Manana
2024-02-23 17:22 ` Anand Jain
2024-02-19 19:48 ` [PATCH v2 05/10] btrfs: check if cloned device mounts with tempfsid Anand Jain
2024-02-20 16:44 ` Filipe Manana
2024-02-23 17:35 ` Anand Jain
2024-02-19 19:48 ` [PATCH v2 06/10] btrfs: test case prerequisite _require_btrfs_mkfs_uuid_option Anand Jain
2024-02-20 16:47 ` Filipe Manana
2024-02-19 19:48 ` [PATCH v2 07/10] btrfs: introduce helper for creating cloned devices with mkfs Anand Jain
2024-02-20 16:51 ` Filipe Manana
2024-02-23 17:44 ` Anand Jain [this message]
2024-02-19 19:48 ` [PATCH v2 08/10] btrfs: verify tempfsid clones using mkfs Anand Jain
2024-02-20 16:55 ` Filipe Manana
2024-02-24 11:41 ` Anand Jain
2024-02-19 19:48 ` [PATCH v2 09/10] btrfs: validate send-receive operation with tempfsid Anand Jain
2024-02-20 16:57 ` Filipe Manana
2024-02-24 0:53 ` Anand Jain
2024-02-19 19:48 ` [PATCH v2 10/10] btrfs: test tempfsid with device add, seed, and balance Anand Jain
2024-02-20 17:05 ` Filipe Manana
2024-02-24 11:29 ` Anand Jain
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=a5a0042e-a8c8-4e29-a752-fb1b49db5584@oracle.com \
--to=anand.jain@oracle.com \
--cc=fdmanana@kernel.org \
--cc=fstests@vger.kernel.org \
--cc=linux-btrfs@vger.kernel.org \
--cc=zlang@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox