All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Christian Völker" <cvoelker@knebb.de>
To: linux-btrfs@vger.kernel.org, David Sterba <dsterba@suse.cz>
Subject: Re: Adding Device Fails - Why?
Date: Tue, 2 Mar 2021 08:10:15 +0100	[thread overview]
Message-ID: <4a7b34e7-ca78-782e-1470-20ea4f81cd98@knebb.de> (raw)
In-Reply-To: <6e37dc95-cca7-a7fc-774a-87068f03c16b@gmx.com>

Hi Qu Wenro,

thanks for debugging this. What I am wondering- why did it work when 
creating the initial device?
For Debian it looks like there is no other version of btrfs-progs 
available, so I used this version (5.10.1-1) to create the btrfs device.

And may I workaround this issue by manually creating a softlink 
/dev/manualdevice to /dev/mappper/crypt_drbd3? The link will be gone 
after reboot but btrfs should then find the device by it's UUID, 
shouldn't it?

Greetings

/KNEBB


Am 02.03.2021 um 02:18 schrieb Qu Wenruo:
>
>
> On 2021/3/2 上午1:24, Christian Völker wrote:
>> Hi,
>>
>> just a little update on the issue.
>>
>> As soon as I omit the encryption part I can easily add the device to the
>> btrfs filesystem. It does not matter if the crypted device is on top of
>> DRBD or directly on the /dev/sdc. In both cases btrs refuses to add the
>> device when a luks-encrypted device is on top.
>>
>> In case I am swapping my setup (drbd on top of encryption) and add the
>> drbd device to btrfs it works without any issues.
>>
>> However, I prefer the other way round- and as the other two btrfs
>> devices are both encryption on top of drbd it should work...
>>
>> It appears it does not like to add a third device-mapper device...
>>
>> Let me know how I can help in debugging. If i have some time I will
>> setup a machine trying to reproduce this.
>
> Got the problem reproduced here.
>
> And surprisingly, it's something related to btrfs-progs, not the kernel.
>
> I just added one debug info in btrfs-progs, it shows:
>
> $ sudo ./btrfs dev add /dev/test/scratch2  /mnt/btrfs
> cmd_device_add: path=dm-5
> ERROR: error adding device 'dm-5': No such file or directory
>
> See the problem?
>
> The path which should be passed to kernel lacks the "/dev/test/" prefix,
> thus it's not pointing to correct path and cause the ENOENT error, since
> there is no "dm-5" in current path.
>
> Thankfully it's already fixed in devel branch with commit 2347b34af4d8
> ("btrfs-progs: fix device mapper path canonicalization").
>
> The offending patch is 922eaa7b5472 ("btrfs-progs: build: fix linking
> with static libmount"), which is in v5.10.1.
>
> You can revert back to v5.10 to workaroud it.
>
>
> TO David,
>
> Would you consider to add a new v5.10.2 to fix the problem? As it seems
> to affect the end user quite badly.
>
> Thanks,
> Qu
>>
>> any ideas otherwise? Let me know!
>>
>> Thanks!
>>
>> /KNEBB
>>


  reply	other threads:[~2021-03-03  2:01 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-01 11:19 Adding Device Fails - Why? Christian Völker
2021-03-01 11:44 ` Hugo Mills
2021-03-01 12:06 ` Qu Wenruo
2021-03-01 12:10   ` Christian Völker
2021-03-01 17:24 ` Christian Völker
2021-03-02  1:18   ` Qu Wenruo
2021-03-02  7:10     ` Christian Völker [this message]
2021-03-02  7:26     ` Christian Völker
     [not found]     ` <4890dd37-3ef1-e589-9fd1-543a993436c4@knebb.de>
2021-03-02  7:31       ` Qu Wenruo
2021-03-02 21:24         ` Christian Völker

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=4a7b34e7-ca78-782e-1470-20ea4f81cd98@knebb.de \
    --to=cvoelker@knebb.de \
    --cc=dsterba@suse.cz \
    --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.