public inbox for fstests@vger.kernel.org
 help / color / mirror / Atom feed
From: Anand Jain <anand.jain@oracle.com>
To: Filipe Manana <fdmanana@kernel.org>
Cc: fstests@vger.kernel.org, linux-btrfs@vger.kernel.org
Subject: Re: [PATCH 2/6 v3] common/rc: _destroy_loop_device confirm arg1 is set
Date: Tue, 31 Oct 2023 07:48:22 +0800	[thread overview]
Message-ID: <f3b1e097-b692-4016-b44f-fa79941709ae@oracle.com> (raw)
In-Reply-To: <CAL3q7H7P+U0a2a4SeeQKXm3-jDZcnoXhrM_4mMHdTiM_iG7dvQ@mail.gmail.com>



On 10/31/23 00:21, Filipe Manana wrote:
> On Mon, Oct 30, 2023 at 2:15 PM Anand Jain <anand.jain@oracle.com> wrote:
>>
>> Check if the dev arg1 is set before calling losetup -d on it.
> 
> Why?
> 
> Do we have any callers that call the function without an argument?
> More comments below.
> 
>>
>> Signed-off-by: Anand Jain <anand.jain@oracle.com>
>> ---
>>   common/rc | 5 ++++-
>>   1 file changed, 4 insertions(+), 1 deletion(-)
>>
>> diff --git a/common/rc b/common/rc
>> index 18d2ddcf8e35..e7d6801b20e8 100644
>> --- a/common/rc
>> +++ b/common/rc
>> @@ -4150,7 +4150,10 @@ _create_loop_device()
>>   _destroy_loop_device()
>>   {
>>          local dev=$1
>> -       losetup -d $dev || _fail "Cannot destroy loop device $dev"
>> +
>> +       if [ ! -z $dev ]; then
>> +               losetup -d $dev || _fail "Cannot destroy loop device $dev"
>> +       fi
> 
> So this is just ignoring if no argument is given and the function does nothing.
> This is quite the opposite of everywhere else, where we error out if a
> necessary argument is missing.
> 

> btrfs/219 never calls this function without the argument,
> both before
> and after this patchset, so I don't see why this patch is needed.

You are right. We no longer need this patch. In version 2, we had the
last mount called with or without temp-fsid. That's being removed,
and initialization is taken care of, so we can drop this patch.
I'll drop this patch.

> If we have any callers not passing the argument, I'd rather fix them
> and make the function error out if no argument is given.

Thanks, Anand

  reply	other threads:[~2023-10-30 23:48 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-30 14:15 [PATCH 0/6 v3] btrfs/219 cloned-device mount capability update Anand Jain
2023-10-30 14:15 ` [PATCH 1/6 v3] common/rc: _fs_sysfs_dname fetch fsid using btrfs tool Anand Jain
2023-10-30 16:16   ` Filipe Manana
2023-10-30 23:48     ` Anand Jain
2023-10-30 14:15 ` [PATCH 2/6 v3] common/rc: _destroy_loop_device confirm arg1 is set Anand Jain
2023-10-30 16:21   ` Filipe Manana
2023-10-30 23:48     ` Anand Jain [this message]
2023-10-30 14:15 ` [PATCH 3/6 v3] common/btrfs: add helper _has_btrfs_sysfs_feature_attr Anand Jain
2023-10-30 16:23   ` Filipe Manana
2023-10-30 23:29     ` Anand Jain
2023-10-31 11:34       ` Filipe Manana
2023-10-30 14:15 ` [PATCH 4/6 v3] btrfs/219: fix _cleanup() to successful release the loop-device Anand Jain
2023-10-30 16:29   ` Filipe Manana
2023-11-02 11:28     ` [PATCH v4 0/5] btrfs/219 cloned-device mount capability update Anand Jain
2023-10-31  0:53       ` [PATCH v4 3/5] btrfs/219: fix _cleanup() to successful release the loop-device Anand Jain
2023-10-31 11:41         ` Filipe Manana
2023-10-31 14:32           ` Anand Jain
2023-11-01 11:20         ` Zorro Lang
2023-11-02 11:37           ` Anand Jain
2023-11-02 11:28         ` Anand Jain
2023-11-02 11:28       ` [PATCH v4 1/5] common/rc: _fs_sysfs_dname fetch fsid using btrfs tool Anand Jain
2023-11-02 20:00         ` David Sterba
2023-11-02 23:01           ` Anand Jain
2023-11-02 11:28       ` [PATCH v4 2/5] common/btrfs: add helper _has_btrfs_sysfs_feature_attr Anand Jain
2023-11-02 11:28       ` [PATCH v4 4/5] btrfs/219: cloned-device mount capability update Anand Jain
2023-11-02 11:28       ` [PATCH v4 5/5] btrfs/219: add to the auto group Anand Jain
2023-10-30 14:15 ` [PATCH 5/6 v3] btrfs/219: cloned-device mount capability update Anand Jain
2023-10-30 16:31   ` Filipe Manana
2023-10-30 14:15 ` [PATCH 6/6 v3] btrfs/219: add to the auto group Anand Jain
2023-10-30 16:32   ` Filipe Manana

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=f3b1e097-b692-4016-b44f-fa79941709ae@oracle.com \
    --to=anand.jain@oracle.com \
    --cc=fdmanana@kernel.org \
    --cc=fstests@vger.kernel.org \
    --cc=linux-btrfs@vger.kernel.org \
    /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