public inbox for linux-btrfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Goffredo Baroncelli <kreijack@inwind.it>
To: Anand Jain <anand.jain@oracle.com>, linux-btrfs@vger.kernel.org
Cc: josef@toxicpanda.com, dsterba@suse.com, nborisov@suse.com, l@damenly.su
Subject: Re: [PATCH v4 3/4] btrfs: add device major-minor info in the struct btrfs_device
Date: Thu, 13 Jan 2022 07:09:17 +0100	[thread overview]
Message-ID: <092d352f-0e4d-1636-5bf9-6f44fb549298@inwind.it> (raw)
In-Reply-To: <324c7f27-05ee-c4bb-49a7-08c06a356b1c@oracle.com>

On 12/01/2022 04.17, Anand Jain wrote:
> 
> 
[...]
>>
>> Ok, I think that this case (where devt!=0 and bdev==NULL) should be inserted as comment in the structure before the devt field.
> 
> I will add but, did you find any pitfall for breaking such a case?
> Or are you submitting any patch based on this rule?

In a patch that I sent few days ago, I exported the major/minor
in <UUID>/devinfo/<devid>/major-minor sysfs property.
In order to do that, I taken the values from btrfs_device->bdev->bd_dev,
checking that bdev is not NULL.
So I didn't understood why we need to add copy of devt also
is the btrfs_device structure, because it is easy to taken the bdev one.

You answer was "we need that, because sometime bdev is NULL even
if a reasonable devt value exist", which is a valid reason.
So I suggest to add this info in the header so even the "next" developer
with a no so deep knowledge of the btrfs device life-cycle will be
aware of this case.

BR
G.Baroncelli
-- 
gpg @keyserver.linux.it: Goffredo Baroncelli <kreijackATinwind.it>
Key fingerprint BBF5 1610 0B64 DAC6 5F7D  17B2 0EDA 9B37 8B82 E0B5

  reply	other threads:[~2022-01-13  6:09 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-10 13:23 [PATCH v4 0/4] btrfs: match device by dev_t Anand Jain
2022-01-10 13:23 ` [PATCH v4 1/4] btrfs: harden identification of the stale device Anand Jain
2022-01-10 14:41   ` Nikolay Borisov
2022-01-11  4:50     ` [External] : " Anand Jain
2022-01-10 13:23 ` [PATCH v4 2/4] btrfs: redeclare btrfs_stale_devices arg1 to dev_t Anand Jain
2022-01-10 15:20   ` Nikolay Borisov
2022-01-11  4:51     ` [External] : " Anand Jain
2022-01-11  8:30       ` Nikolay Borisov
2022-01-11 12:36         ` Anand Jain
2022-01-11 12:49           ` Nikolay Borisov
2022-01-11 13:58             ` Nikolay Borisov
2022-01-12  4:13               ` Anand Jain
2022-01-10 13:23 ` [PATCH v4 3/4] btrfs: add device major-minor info in the struct btrfs_device Anand Jain
2022-01-10 20:13   ` Goffredo Baroncelli
2022-01-11  5:27     ` Anand Jain
2022-01-11 17:18       ` Goffredo Baroncelli
2022-01-12  3:17         ` Anand Jain
2022-01-13  6:09           ` Goffredo Baroncelli [this message]
2022-01-10 13:23 ` [PATCH v4 4/4] btrfs: use dev_t to match device in device_matched 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=092d352f-0e4d-1636-5bf9-6f44fb549298@inwind.it \
    --to=kreijack@inwind.it \
    --cc=anand.jain@oracle.com \
    --cc=dsterba@suse.com \
    --cc=josef@toxicpanda.com \
    --cc=l@damenly.su \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=nborisov@suse.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