linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* BUG: btrfs confused by two different fs with the same UUID mounted in different moment
@ 2021-12-14 22:45 Goffredo Baroncelli
  2021-12-15 14:24 ` Nikolay Borisov
  0 siblings, 1 reply; 2+ messages in thread
From: Goffredo Baroncelli @ 2021-12-14 22:45 UTC (permalink / raw)
  To: linux-btrfs

Hi all,

I found this bug during a develop of a test for BTRFS. Steps to reproduce


# create a filesystem with TWO loop-devices; mount it then *destroy it*
UUID=292afefb-6e8c-4fb3-9d12-8c4ecb1f2374
rm /tmp/d1
rm /tmp/d2
truncate -s 1G /tmp/d1
truncate -s 1G /tmp/d2
sudo losetup /dev/loop1 /tmp/d1
sudo losetup /dev/loop2 /tmp/d2
sudo mkfs.btrfs -U $UUID /dev/loop1 /dev/loop2
sudo mount /dev/loop1 /mnt/btrfs1
sudo umount /dev/loop1
sudo losetup -d /dev/loop2	# <---- NOTE HERE
sudo losetup -d /dev/loop1	# <---- NOTE HERE

# create a new filesystem with only ONE loop-device; mount it
rm /tmp/d1
truncate -s 1G /tmp/d1
sudo losetup /dev/loop1 /tmp/d1
sudo mkfs.btrfs -U $UUID /dev/loop1
sudo mount /dev/loop1 /mnt/btrfs1

# BUG: now under $UUID/devinfo there are TWO devices
# expected behavior: only one device is showed
ls /sys/fs/btrfs/$UUID/devinfo
1  2

# under $UUID/devices there is ONE device1
ls /sys/fs/btrfs/$UUID/devices
loop1



Obviously this is caused by the fact that the two filesystem have the same UUID. However I think that in any case $UUID/devices and $UUID/devinfo should show the same devices.


BR

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-12-15 14:24 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-14 22:45 BUG: btrfs confused by two different fs with the same UUID mounted in different moment Goffredo Baroncelli
2021-12-15 14:24 ` Nikolay Borisov

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).