Linux Btrfs filesystem development
 help / color / mirror / Atom feed
* [6.9 behaviour change] subvolume device ID no longer present in /proc/self/mountinfo
@ 2024-05-28 22:37 Thiago Macieira
  0 siblings, 0 replies; only message in thread
From: Thiago Macieira @ 2024-05-28 22:37 UTC (permalink / raw)
  To: linux-btrfs

[-- Attachment #1: Type: text/plain, Size: 1934 bytes --]

Re: https://bugreports.qt.io/browse/QTBUG-125721

Summary: the submodule's block device ID is no longer present in 
/proc/self/mountinfo. Instead, the root device ID is now shown and that does 
not match what you get from stat().

Qt's QStorageInfo class used to use this matching to detect when a filesystem 
had been mounted over and were no longer accessible. With the change in kernel 
behaviour, QStorageInfo always concludes all btrfs subvolumes are mounted 
over.

When you mount a subvolume, the subvolume gets its own device ID:

# mount -o loop fs foo    
# btrfs sub create foo/@
Create subvolume 'foo/@'
# btrfs sub create foo/@home
Create subvolume 'foo/@home'
# mkdir foo/@/home
# umount foo 

# mount -o loop,subvol=/@ fs foo
# mount -o loop,subvol=/@home fs foo/home
# stat -c %d foo
149
# stat -c %d foo/home/
94

In 6.8.8:
# grep loop0 /proc/self/mountinfo 
340 35 0:149 /@ /tmp/foo rw,relatime shared:310 - btrfs /dev/loop0 
rw,ssd,discard=async,space_cache=v2,subvolid=256,subvol=/@
450 340 0:94 /@home /tmp/foo/home rw,relatime shared:1049 - btrfs /dev/loop0 
rw,ssd,discard=async,space_cache=v2,subvolid=257,subvol=/@home

In 6.9.1:
$ stat -c %d foo foo/home; grep loop0 /proc/self/mountinfo
153
154
486 58 0:151 /@ /tmp/foo rw,relatime shared:445 - btrfs /dev/loop0 
rw,ssd,discard=async,space_cache=v2,subvolid=256,subvol=/@
496 486 0:151 /@home /tmp/foo/home rw,relatime shared:455 - btrfs /dev/loop0 
rw,ssd,discard=async,space_cache=v2,subvolid=257,subvol=/@home

Note that how device 151 is not the same as reported by stat().

I need to know if this behaviour is expected and will remain, or if it will be 
fixed, or alternatively if it is a configuration problem somewhere. If it is 
expected, I will need to find a workaround to solving my problem.

Thank you in advance, best regards,
-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Principal Engineer - Intel DCAI Fleet Engineering and Quality

[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 5152 bytes --]

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2024-05-28 22:37 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-05-28 22:37 [6.9 behaviour change] subvolume device ID no longer present in /proc/self/mountinfo Thiago Macieira

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox