[PATCH] vfs_btrfs: add qgroup-aware disk free support

Uri Simchoni uri at samba.org
Thu Jan 14 04:58:47 UTC 2016

On 01/14/2016 04:35 AM, Justin Maggard wrote:
> On Wed, Jan 13, 2016 at 4:37 PM, Jeremy Allison <jra at samba.org> wrote:
>> On Wed, Jan 13, 2016 at 04:27:48PM -0800, Justin Maggard wrote:
>>> Add support for qgroup-aware representation of disk free statistics to
>>> vfs_btrfs.  If max_rfer has been defined on the subvolume, use metrics
>>> from qgroups to represent disk free.
>>> This can be disabled by setting "btrfs:qgroup dfree" to false in smb.conf.
>> Justin, can you rebase this on top of the dfree/quota changes
>> that Uri has made recently (not in the tree yet, but the
>> patches are available on the list).
> I pulled Uri's patchset into my local tree, and this patch still
> applies and everything still builds without errors.  Or was that not
> the point? :-)
> -Justin
I haven't carefully reviewed this patch but I can see something that may 
be wrong, namely that if there's quota, it returns info based on the 
quota and not on disk actual size and usage. Therefore if the quotas are 
over-provisioned and the disk is almost full, it would return a greater 
value than actual disk size and free space.

This is exactly the kind of error I was trying to prevent with my recent 
patch - let the quota VFS (which now has a path parameter) deal with 
quota, let the disk_free VFS deal with disk stats (it appears it won't 
require a change for btrfs), and let the server code sort it out. 
Another benefit is consistency between disk-free and quota SMB requests 
(we currently only provide quota info in SMB1 but that may change).

I'm not at all familiar with btrfs qgroups and their semantics, but 
perhaps it would be possible to use the modified get_quota_fn VFS 
function for it?

More information about the samba-technical mailing list