Bug 10541 - sys_path_to_bdev fails for btrfs subvolumes
sys_path_to_bdev fails for btrfs subvolumes
Status: ASSIGNED
Product: Samba 4.1 and newer
Classification: Unclassified
Component: File services
4.1.6
All All
: P5 normal
: ---
Assigned To: David Disseldorp
Samba QA Contact
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2014-04-05 12:32 UTC by Andreas Noever
Modified: 2016-06-12 15:44 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andreas Noever 2014-04-05 12:32:46 UTC
smbd prints

[2014/04/05 13:25:20.282135,  0] ../source3/lib/sysquotas.c:406(sys_get_quota)
sys_path_to_bdev() failed for path [.]!

whenever a path from a btrfs subvolume is accessed (for example when typing ls in smbclient).

I did some debugging and the reason is that btrfs has per subvolume st_dev values, but only the main volume appears in getmntent(). The loop in sys_path_to_bdev thus fails to find the mount path.

----

I have only one mounted partition
mount
/dev/sda3 on / type btrfs (rw,relatime,space_cache)

/mnt is a folder and /mnt/data, /mnt/data/share are subvolumes:
stat /
Device: 12h/18d	Inode: 256
stat /mnt
Device: 12h/18d	Inode: 2512
stat /mnt/data
Device: 26h/38d	Inode: 256
stat /mnt/data/share
Device: 2dh/45d	Inode: 256
Comment 1 David Disseldorp 2014-11-05 11:37:06 UTC
Thanks for the report Andreas, I've hit this one too.

Btrfs quotas are applied at a subvolume level and can restrict total, unshared or compressed data usage. Handling of this filesystem specific behaviour may be better suited for the vfs_btrfs module. I need to take a closer look.
Comment 2 Björn Jacke 2014-11-06 11:02:34 UTC
there is a similar problem for XFS. XFS also has the concept of directory based quotas (project quota). I think the concept of directory based quota is hard to get in line with SMB quotas, which have no clue of directory based quotas AFAIK. In any case I think if we can find a good solution in Samba it should be generic and not in vfs_btrfs only.
Comment 3 Alessandro Bruni 2014-12-21 12:35:03 UTC
Hi all, are there updates on this bug? I hit the problem on my configuration, and I'd like to help if needed.
Comment 4 Björn Jacke 2015-12-04 08:53:24 UTC
Dave, did you make any progress here? Any idea how to solve that?

Afaik Windows allows setting quota on junction points. Mapping subvolumes to junction points might be a way to cleanly map the subvolume quota problem to the windows world. Though, I think our support for junction points generally needs to be improved for that.
Comment 5 Raul 2016-06-12 15:44:39 UTC
This happens with a zfs filesystem as well.