Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
6.6.67 breaks /proc/mounts & lsblk output
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
sdauth
l33t
l33t


Joined: 19 Sep 2018
Posts: 660
Location: Ásgarðr

PostPosted: Fri Dec 27, 2024 1:11 pm    Post subject: 6.6.67 breaks /proc/mounts & lsblk output Reply with quote

Hello,
I updated my kernel to 6.6.67 on my desktop (openrc) then rebooted,
now the lsblk output doesn't show all my mountpoints (btrfs)
edit: All mountpoints are correctly mounted by the way. Confirmed with "df -h".

Code:
NAME         MAJ:MIN RM   SIZE RO TYPE  MOUNTPOINTS
sda            8:0    0   9,1T  0 disk 
└─sda1         8:1    0   9,1T  0 part 
  └─hdd3     254:7    0   9,1T  0 crypt /mnt/hdd3
sdb            8:16   0   9,1T  0 disk 
└─sdb1         8:17   0   9,1T  0 part 
  └─hdd2     254:6    0   9,1T  0 crypt /mnt/hdd2


With kernel 6.6.62:
Code:
NAME         MAJ:MIN RM   SIZE RO TYPE  MOUNTPOINTS
sda            8:0    0   9,1T  0 disk 
└─sda1         8:1    0   9,1T  0 part 
  └─hdd3     254:7    0   9,1T  0 crypt /mnt/hdd3
                                        /mnt/dump
sdb            8:16   0   9,1T  0 disk 
└─sdb1         8:17   0   9,1T  0 part 
  └─hdd2     254:6    0   9,1T  0 crypt /mnt/hdd2
                                        /var/cache/distfiles
                                        /var/cache/binpkgs


also, now /proc/mounts reads:

Code:
/dev/dm-6 /mnt/hdd2 btrfs rw,relatime,space_cache=v2,subvolid=258,subvol=/hdd2 0 0
/dev/dm-7 /mnt/hdd3 btrfs rw,relatime,space_cache=v2,subvolid=256,subvol=/hdd3 0 0


instead of:

Code:
/dev/mapper/hdd2 /mnt/hdd2 btrfs rw,relatime,space_cache=v2,subvolid=258,subvol=/hdd2 0 0
/dev/mapper/hdd3 /mnt/hdd3 btrfs rw,relatime,space_cache=v2,subvolid=256,subvol=/hdd3 0 0


After a quick search, I found this commit introduced in kernel 6.6.66, which seems to trigger the issue.
If I reboot to 6.6.62 kernel, the /proc/mounts and lsblk output is ok.

Code:
commit a5d74fa247529f8d2169e68a47c32497f565263a
Author: Qu Wenruo <wqu@suse.com>
Date:   Tue Sep 24 12:52:17 2024 +0930

    btrfs: avoid unnecessary device path update for the same device
   
    [ Upstream commit 2e8b6bc0ab41ce41e6dfcc204b6cc01d5abbc952 ]
   
    [PROBLEM]
    It is very common for udev to trigger device scan, and every time a
    mounted btrfs device got re-scan from different soft links, we will get
    some of unnecessary device path updates, this is especially common
    for LVM based storage:
   
     # lvs
      scratch1 test -wi-ao---- 10.00g
      scratch2 test -wi-a----- 10.00g
      scratch3 test -wi-a----- 10.00g
      scratch4 test -wi-a----- 10.00g
      scratch5 test -wi-a----- 10.00g
      test     test -wi-a----- 10.00g
   
     # mkfs.btrfs -f /dev/test/scratch1
     # mount /dev/test/scratch1 /mnt/btrfs
     # dmesg -c
     [  205.705234] BTRFS: device fsid 7be2602f-9e35-4ecf-a6ff-9e91d2c182c9 devid 1 transid 6 /dev/mapper/test-scratch1 (253:4) scanned by mount (1154)
     [  205.710864] BTRFS info (device dm-4): first mount of filesystem 7be2602f-9e35-4ecf-a6ff-9e91d2c182c9
     [  205.711923] BTRFS info (device dm-4): using crc32c (crc32c-intel) checksum algorithm
     [  205.713856] BTRFS info (device dm-4): using free-space-tree
     [  205.722324] BTRFS info (device dm-4): checking UUID tree
   
    So far so good, but even if we just touched any soft link of
    "dm-4", we will get quite some unnecessary device path updates.
   
     # touch /dev/mapper/test-scratch1
     # dmesg -c
     [  469.295796] BTRFS info: devid 1 device path /dev/mapper/test-scratch1 changed to /dev/dm-4 scanned by (udev-worker) (1221)
     [  469.300494] BTRFS info: devid 1 device path /dev/dm-4 changed to /dev/mapper/test-scratch1 scanned by (udev-worker) (1221)
   
    Such device path rename is unnecessary and can lead to random path
    change due to the udev race.
   
    [CAUSE]
    Inside device_list_add(), we are using a very primitive way checking if
    the device has changed, strcmp().
   
    Which can never handle links well, no matter if it's hard or soft links.
   
    So every different link of the same device will be treated as a different
    device, causing the unnecessary device path update.
   
    [FIX]
    Introduce a helper, is_same_device(), and use path_equal() to properly
    detect the same block device.
    So that the different soft links won't trigger the rename race.
   
    Reviewed-by: Filipe Manana <fdmanana@suse.com>
    Link: https://bugzilla.suse.com/show_bug.cgi?id=1230641
    Reported-by: Fabian Vogt <fvogt@suse.com>
    Signed-off-by: Qu Wenruo <wqu@suse.com>
    Signed-off-by: David Sterba <dsterba@suse.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>


I don't have time to fill a bug report or deal with this right now (I masked 6.6.67...) so let's keep this thread as a reminder.. :oops:
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum