Package: src:linux Version: 4.9.13-1 Severity: normal I'm using DRBD to keep a backup of my root filesystem (multiple snapshots on remote machine).
Now I wanted to access an old version of a file; so I got me access to the right snapshot (again via DRBD), and tried to mount the filesystem. First I noticed that the actually passed in block device wasn't even used; btrfs noticed that a filesystem with the same UUID is already mounted, and so "helpfully" just mounted the (*wrong*) block device at the new location. When I finally realized that, I umounted the new location and tried to use "btrfstune" to change the snapshot's UUID, so that I can mount that independently. Much to my surprise "btrfstune" just told me <device> is mounted and after a brief investigation this showed to be true - /proc/mounts now showed the _snapshot_ device as being in use for my root filesystem! I could "fix" that by mounting my root device at the new location: [root@cacao:/mnt]$ grep mapper /proc/self/mounts /dev/mapper/hrbg / btrfs rw,nodiratime,relatime,space_cache,subvolid=5,subvol=/ 0 0 [root@cacao:/mnt]$ mount /dev/mapper/sda2_crypt /mnt/tmp3 [root@cacao:/mnt]$ grep mapper /proc/self/mounts /dev/mapper/sda2_crypt / btrfs rw,nodiratime,relatime,space_cache,subvolid=5,subvol=/ 0 0 /dev/mapper/sda2_crypt /mnt/tmp3 btrfs rw,relatime,space_cache,subvolid=5,subvol=/ 0 0 So, *) silently mounting the wrong device at the new location is very bad behaviour; having a message Filesystem with that UUID already mounted would be a bit better (but not much, I hate the same thing in XFS too) *) changing the block device of the old location is a bug -- I don't believe that the accesses are really done against the new location, and if they were, that would be even worse. Thank you for your attention! -- Package-specific info: ** Version: Linux version 4.9.0-2-amd64 (debian-kernel@lists.debian.org) (gcc version 6.3.0 20170221 (Debian 6.3.0-8) ) #1 SMP Debian 4.9.13-1 (2017-02-27) ** Command line: BOOT_IMAGE=/vmlinuz-4.9.0-2-amd64 root=UUID=1bfc62e3-f883-42f0-a2aa-3c67ee6f563f ro quiet no_console_suspend=1 noresume cryptopts=source=/dev/drbd9,target=sda2_crypt,discard,rootdev cgroup_enable=memory swapaccount=1 ** Tainted: POE (12289) * Proprietary module has been loaded. broadcom-sta == wl * Out-of-tree module has been loaded. drbd * Unsigned module has been loaded. drbd ** Kernel log: Unable to read kernel log; any relevant messages should be attached ** Loaded modules: hmac hid_cherry hid_generic nfnetlink_queue wl(POE) xt_CHECKSUM iptable_mangle ipt_MASQUERADE nf_nat_masquerade_ipv4 tun bridge stp llc xt_nat iptable_nat nf_nat_ipv4 nf_nat nf_conntrack_ipv4 nf_defrag_ipv4 xt_conntrack nf_conntrack xt_NFLOG nfnetlink_log nfnetlink ipt_REJECT nf_reject_ipv4 xt_comment xt_tcpudp ebtable_filter ebtables ip6table_filter ip6_tables iptable_filter cpufreq_userspace cpufreq_powersave cpufreq_conservative cmac bnep uinput edac_mce_amd edac_core kvm_amd kvm irqbypass joydev pcspkr binfmt_misc evdev nls_ascii btusb btrtl btbcm uvcvideo videobuf2_vmalloc videobuf2_memops btintel nls_cp437 videobuf2_v4l2 bluetooth videobuf2_core videodev vfat media serio_raw fat efi_pstore efivars k10temp amdkfd snd_hda_codec_conexant snd_hda_codec_generic radeon snd_hda_codec_hdmi snd_hda_intel snd_hda_codec ttm snd_hda_core snd_hwdep rtsx_pci_ms snd_pcm_oss snd_mixer_oss memstick drm_kms_helper cfg80211 snd_pcm thinkpad_acpi snd_timer drm nvram snd sg soundcore i2c_algo_bit rfkill shpchp ac wmi battery acpi_cpufreq tpm_tis tpm_tis_core video button tpm sbs sbshc brd nfsd auth_rpcgss nfs_acl lockd grace loop parport_pc sunrpc ppdev lp parport efivarfs ip_tables x_tables autofs4 algif_skcipher af_alg raid10 raid456 async_raid6_recov async_memcpy async_pq async_xor async_tx raid1 raid0 multipath linear lru_cache md_mod dm_crypt dm_mod uhci_hcd usbhid hid ext4 crc16 jbd2 fscrypto ecb mbcache drbd(OE) libcrc32c btrfs crc32c_generic xor mmc_block raid6_pq sr_mod cdrom sd_mod ohci_pci crct10dif_pclmul crc32_pclmul crc32c_intel rtsx_pci_sdmmc mmc_core ghash_clmulni_intel aesni_intel aes_x86_64 lrw gf128mul glue_helper ablk_helper cryptd psmouse ahci libahci ohci_hcd libata ehci_pci ehci_hcd xhci_pci xhci_hcd scsi_mod usbcore i2c_piix4 rtsx_pci r8169 mfd_core usb_common mii fjes -- System Information: Debian Release: 9.0 APT prefers testing APT policy: (990, 'testing'), (500, 'unstable'), (500, 'stable'), (1, 'experimental') Architecture: amd64 (x86_64) Kernel: Linux 4.9.0-2-amd64 (SMP w/4 CPU cores) Locale: LANG=de_AT.UTF-8, LC_CTYPE=de_AT.UTF-8 (charmap=UTF-8) Shell: /bin/sh linked to /bin/dash Init: systemd (via /run/systemd/system) Versions of packages linux-image-4.9.0-2-amd64 depends on: ii initramfs-tools [linux-initramfs-tool] 0.127 ii kmod 23-2 ii linux-base 4.5 Versions of packages linux-image-4.9.0-2-amd64 recommends: ii firmware-linux-free 3.4 ii irqbalance 1.1.0-2.3 Versions of packages linux-image-4.9.0-2-amd64 suggests: pn debian-kernel-handbook <none> ii extlinux 3:6.03+dfsg-14.1 ii grub-efi-amd64 2.02~beta3-5 pn linux-doc-4.9 <none> Versions of packages linux-image-4.9.0-2-amd64 is related to: ii firmware-amd-graphics 20161130-2 pn firmware-atheros <none> pn firmware-bnx2 <none> ii firmware-bnx2x 20161130-2 ii firmware-brcm80211 20161130-2 pn firmware-cavium <none> pn firmware-intel-sound <none> pn firmware-intelwimax <none> pn firmware-ipw2x00 <none> pn firmware-ivtv <none> pn firmware-iwlwifi <none> pn firmware-libertas <none> ii firmware-linux-nonfree 20161130-2 ii firmware-misc-nonfree 20161130-2 pn firmware-myricom <none> pn firmware-netxen <none> pn firmware-qlogic <none> ii firmware-realtek 20161130-2 pn firmware-samsung <none> pn firmware-siano <none> pn firmware-ti-connectivity <none> pn xen-hypervisor <none> -- no debconf information