From: Anand Jain <anand.jain@oracle.com>
To: Marc MERLIN <marc@merlins.org>
Cc: Nikolay Borisov <nborisov@suse.com>,
dsterba@suse.com, 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 11:33:23 +0800 [thread overview]
Message-ID: <0d2ea8e2-cbe8-ca64-d0d4-fa70b8cad8b1@oracle.com> (raw)
In-Reply-To: <20200326013007.GS15123@merlins.org>
On 3/26/20 9:30 AM, Marc MERLIN wrote:
> On Thu, Mar 26, 2020 at 07:56:10AM +0800, Anand Jain wrote:
>>> 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.
>
> I'm confused: why is --forget even needed? Why would it remember devices
> that were unmounted and not part of a new scan?
>
> And yes, the device was not unmounted. The sata layer failed, device
> disappeared while mounted and then re-appeared
> I was able to force umount the mountpoints, so maybe --forget would have
> helped, but I'm confused as to why it even exists.
>
We would log the below only if the old device sde is still in mounted
state. Unfortunately we don't have the unmount event log yet (patches
are in the ML) so we don't know if unmount was successful.
[2560416.434529] BTRFS warning (device sde1): duplicate device
fsid:devid for 727c7ba3-f6f9-462a-8472-453dd7d46d8a:1 old:/dev/sde1
new:/dev/sdq1
If the device is unmounted, the scan would have replaced the sde
to sdi, unless the sde (stale) generation is > generation in sdi
(lost commit). In which case the --forget is useful to remove the
state device entry (provided device is unmounted).
>> 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.
>
> It was unmounted after disappearing, see the 'grep sde /proc/mounts'
> showing that it wasn't mounted anymore, so it seems that even that part
> didn't work as intended?
Its strange /proc/mounts doesn't list sde. Could you please send me
complete kernel logs. Lets try if there is any clue.
I tried to reproduce.. but in my case the unmount was successful.
$ mkfs.btrfs -fq /dev/sdc && mount /dev/sdc /btrfs
$ devmgt show | grep sdc
host2 sdc
$ devmgt detach /dev/sdc
::
detach /dev/sdc successful
$ devmgt attach host2
::
sd 2:0:0:0: [sdb] Attached SCSI disk
::
BTRFS warning (device sdc): duplicate device fsid:devid for
dcbc5603-e1cf-4d8d-9ec2-832bc3ac4e36:1 old:/dev/sdc new:/dev/sdb
------------------
attach host2 successful
mounts shows sdc is in ro.
$ cat /proc/mounts | grep sdc
/dev/sdc /btrfs btrfs ro,relatime,noacl,space_cache,subvolid=5,subvol=/ 0 0
$ dmesg -k | tail
[ 1427.268767] BTRFS warning (device sdc): duplicate device fsid:devid
for dcbc5603-e1cf-4d8d-9ec2-832bc3ac4e36:1 old:/dev/sdc new:/dev/sdb
$ umount /dev/sdc
Unfortunately there is no log about the unmount :-(.
And the following device scan replaces the sdc with sdb.
$ btrfs dev scan
Scanning for Btrfs filesystems
$ cat /proc/fs/btrfs/devlist | grep sdc
$ cat /proc/fs/btrfs/devlist | grep sdb
device: /dev/sdb
$
And mount is successful.
$ mount /dev/sdb /btrfs
Thanks, Anand
> Marc
next prev parent reply other threads:[~2020-03-26 3:33 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
2020-03-26 1:30 ` Marc MERLIN
2020-03-26 3:33 ` Anand Jain [this message]
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=0d2ea8e2-cbe8-ca64-d0d4-fa70b8cad8b1@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).