All of lore.kernel.org
 help / color / mirror / Atom feed
From: Anand Jain <anand.jain@oracle.com>
To: Su Yue <l@damenly.su>
Cc: linux-btrfs@vger.kernel.org, dsterba@suse.com
Subject: Re: [PATCH RFC 3/3] btrfs: use latest_bdev in btrfs_show_devname
Date: Fri, 20 Aug 2021 17:13:32 +0800	[thread overview]
Message-ID: <332e2d65-a258-8bf8-8f26-9571535e7075@oracle.com> (raw)
In-Reply-To: <1r6ofu54.fsf@damenly.su>



On 20/08/2021 15:31, Su Yue wrote:
> 
> On Fri 20 Aug 2021 at 02:18, Anand Jain <anand.jain@oracle.com> wrote:
> 
>> latest_bdev is updated according to the changes to the device list.
>> That means we could use the latest_bdev to show the device name in
>> /proc/self/mounts. So this patch makes that change.
>>
>> Signed-off-by: Anand Jain <anand.jain@oracle.com>
>> ---
>>
>> RFC because
>> 1. latest_bdev might not be the lowest devid but, we showed
>> the lowest devid in /proc/self/mount.


>> 2. The device's path is not shown now but, previously we did.
>> So does these break ABI? Maybe yes for 2 howabout for 1 above?

  In v2 I am fix the path part. By replacing latest_bdev to latest_dev
  which means it shall hold the pointer to btrfs_device instead of
  just to its bdev.

> Mabybe a naive question but I have no time to dive into btrfs code
> recently. If a device which has highest devid was replaced, will the
> new device be the fs_devices->latest_bdev instead of the existing older
> one?

  It is handled by btrfs_assign_next_active_device().

  If the replace source device is also the latest_dev then after replace
  it shall point to the replace target device. So the new device path is
  seen in /proc/self/mounts. Which is fine and normal to expect.

  Similarly btrfs_assign_next_active_device() is called during remove
  device as well.

  There is a bug that we didn't update the latest_bdev when we sprout
  I am fixing this as well in v2.

Thanks.

  reply	other threads:[~2021-08-20  9:13 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-19 18:18 [PATCH 0/3] btrf_show_devname related fixes Anand Jain
2021-08-19 18:18 ` [PATCH 1/3] btrfs: fix comment about the btrfs_show_devname Anand Jain
2021-08-19 18:18 ` [PATCH RFC 2/3] btrfs: consolidate device_list_mutex in prepare_sprout to its parent Anand Jain
2021-08-20  7:51   ` Su Yue
2021-08-20  8:53     ` Anand Jain
2021-08-21 14:57       ` Su Yue
2021-08-21 15:00         ` Su Yue
2021-08-23 10:34           ` Anand Jain
2021-08-23 10:54             ` Anand Jain
2021-08-23 12:20               ` David Sterba
2021-08-19 18:18 ` [PATCH RFC 3/3] btrfs: use latest_bdev in btrfs_show_devname Anand Jain
2021-08-20  7:31   ` Su Yue
2021-08-20  9:13     ` Anand Jain [this message]
2021-08-20 10:57   ` David Sterba
2021-08-20 11:03     ` 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=332e2d65-a258-8bf8-8f26-9571535e7075@oracle.com \
    --to=anand.jain@oracle.com \
    --cc=dsterba@suse.com \
    --cc=l@damenly.su \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.