Samba reports disk size and remaining free space (such as when running "dir" in a cmd window on a Windows machine). When quotas are enabled, these numbers are clamped by the quota of the user querying for disk size and remaining free space. The free space is consulted by some client applications. For example, Windows Explorer won't copy a file into a folder if that would exceed the remaining free space. In SMB2 protocol, disk size / free space query is relative to a directory, i.e. it allows querying the free space of each directory separately. When "inherit owner" is enabled, created files and directories receive the owner of their parent directory, and hence the quota that affects the available space is mostly that of the directory owner, not the quota of the user making the request. It is this quota that should be used for calculations to give users the right number, and to give clients the correct hint.
Created attachment 12365 [details] git-am fix for 4.5.0 About the 4.5.0 fix - there's one commit marked as "backported", since in that version lp_inherit_owner() returns a bool. Other than that it's a clean cherry-picking.
Created attachment 12366 [details] git-am fix for 4.4.next About the 4.4.x fix - there are two commits marked as "backported": - one because in that version lp_inherit_owner() returns a bool - another because the dfree tests have changed slightly due to cleanups in 4.5. Additionally there's a one-line additional patch to facilitate the last patch. I've taken the liberty of marking it with Jeremy's RB+, so if someone else ends up reviewing it please pay attention.
Assigning to Karolin for inclusion in 4.5.0 and 4.4.next
Pushed to autobuild-v4-5-test.
Pushed to v4-5-test.
Pushed to autobuild-v4-4-test.
Pushed to both branches. Closing out bug report. Thanks!