From: Anand Jain <anand.jain@oracle.com>
To: Marc MERLIN <marc@merlins.org>,
Nikolay Borisov <nborisov@suse.com>,
dsterba@suse.com
Cc: linux-btrfs@vger.kernel.org, kernel-team@fb.com
Subject: Re: 5.4.20: cannot mount device that blipped off the bus: duplicate device fsid:devid for
Date: Thu, 26 Mar 2020 07:56:10 +0800 [thread overview]
Message-ID: <a9dd1b1a-b38e-a0f4-91e1-b89063e8ae1e@oracle.com> (raw)
In-Reply-To: <20200325201455.GO29461@merlins.org>
Hi Marc,
On 26/3/20 4:14 AM, Marc MERLIN wrote:
> Thanks for the suggestion Nikolay
>
> Dear Anand, David,
>
> I see that
> https://gitlab.freedesktop.org/seanpaul/dpu-staging/commit/228a73abde5c04428678e917b271f8526cfd90ed
> may have helped, but is this really something a user should know/do?
>
> Why does a device that disappeared from the bus, need to be manually
> unregistered?
> Are users really supposed to know this?
> Why does btrfs device scan not invalidate the cache of devices and keep
> remembering a device that's gone (not visible in new scan)?
btrfs device scan --forget is only useful to cleanup the unmounted
devices, per the logs below the device was mounted when it disappeared.
More below.
> Thanks,
> Marc
>
>
> On Sat, Mar 21, 2020 at 11:25:04PM +0200, Nikolay Borisov wrote:
>>
>>
>> On 21.03.20 г. 22:23 ч., Marc MERLIN wrote:
>>> /dev/sde blipped off the bus (hardware issue?) and came
>>> back as /dev/sdq.
>>> Except btrfs won't let me scan or mount it.
>>>
>>> I was able to btrfs check it though and that came back clean.
>>>
>>> gargamel:~# ls -l /dev/sde
>>> ls: cannot access '/dev/sde': No such file or directory
>>>
>>>
>>> gargamel:~# mount /dev/sdq1 /mnt/mnt
>>> mount: /mnt/mnt: mount(2) system call failed: File exists.
>>> gargamel:~# dmesg |tail -1
>>> [2560371.195249] BTRFS warning (device sde1): duplicate device fsid:devid for 727c7ba3-f6f9-462a-8472-453dd7d46d8a:1 old:/dev/sde1 new:/dev/sdq1
This indicates the device was mounted when it disappeared. So it
re-appears with the new path, but as its fsid+uuid+devid matches
with the old still mounted device we rightly consider it as an
alien device and fail the mount.
To avoid assigning new path to the reappearing device we need to
close/pause the device path when it disappears. I need to figure
out if there is any KPI from the block layer to help doing that.
Anyone- any idea if there is anything in the block layer which can
do the callback into the filesystem if the device disappears?
Thanks, Anand
>>>
>>> gargamel:~# btrfs device scan
>>> Scanning for Btrfs filesystems
>>> ERROR: device scan failed on '/dev/sdq1': File exists
>>> ERROR: there are 1 errors while registering devices
>>> gargamel:~# dmesg |tail -1
>>> [2560416.434529] BTRFS warning (device sde1): duplicate device fsid:devid for 727c7ba3-f6f9-462a-8472-453dd7d46d8a:1 old:/dev/sde1 new:/dev/sdq1
>>>
>>> gargamel:~# grep sde /proc/mounts
>>> cgroup2 /sys/fs/cgroup/unified cgroup2 rw,nosuid,nodev,noexec,relatime,nsdelegate 0 0
>>> gargamel:~#
>>>
>>> gargamel:~# lsblk -f |grep 727c7ba3-f6f9-462a-8472-453dd7d46d8a
>>> └─sdq1 btrfs btrfs_space 727c7ba3-f6f9-462a-8472-453dd7d46d8a
>>> gargamel:~#
>>>
>>> So, that FS isn't a duplicate anymore and I see to have no way out except reboot
>>> which I'll do now.
>>>
>>> Was there another way around it? Obviously this is not desirable
>>> behaviour, in the past, I was able to remount the device when it came
>>> back.
>>>
>>
>> Presumably you could have used the device forget functionality that got
>> introduced in 5.1, i.e the BTRFS_IOC_FORGET_DEV ioctl. For more info
>> check out: 228a73abde5c04428678e917b271f8526cfd90ed
>>
>>> Thanks,
>>> Marc
>>>
>>
>
next prev parent reply other threads:[~2020-03-25 23:56 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-21 20:23 5.4.20: cannot mount device that blipped off the bus: duplicate device fsid:devid for Marc MERLIN
2020-03-21 21:25 ` Nikolay Borisov
2020-03-25 20:14 ` Marc MERLIN
2020-03-25 23:56 ` Anand Jain [this message]
2020-03-26 1:30 ` Marc MERLIN
2020-03-26 3:33 ` Anand Jain
2020-03-26 4:26 ` Marc MERLIN
2020-04-14 0:38 ` Marc MERLIN
2020-04-16 10:43 ` Anand Jain
2020-04-19 19:13 ` Marc MERLIN
2020-04-20 11:10 ` Anand Jain
2020-04-20 14:56 ` Marc MERLIN
2020-04-21 7:33 ` Anand Jain
2020-04-22 5:54 ` Marc MERLIN
2020-04-21 7:21 ` [PATCH] btrfs: boilerplate: devlist and fsinfo 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=a9dd1b1a-b38e-a0f4-91e1-b89063e8ae1e@oracle.com \
--to=anand.jain@oracle.com \
--cc=dsterba@suse.com \
--cc=kernel-team@fb.com \
--cc=linux-btrfs@vger.kernel.org \
--cc=marc@merlins.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;
as well as URLs for NNTP newsgroup(s).