The Samba-Bugzilla – Bug 9281
cifs kernel client not reporting quotas
Last modified: 2015-01-23 07:38:04 UTC
We are not able to get proper quota usage from a Linux client (Fedora 17, cifs-utils-5.5-2.fc17.x86_64).
On the client, the 'df' command reports total server filesystem usage and not the assigned user quota.
On the server, we are using Samba-3.6.6 with filesystem quotas activated.
Strangely, Windows (SMB-Samba client) and MacOS (AFP-Netatalk client) both report proper quota disk usage.
We use 'pam_mount' with 'mount.cifs' to mount user home directories on Fedora 17 clients. Everything works great... but not quotas.
Here are the mount options used ( /etc/security/pam_mount.conf.xml ):
<volume fstype="cifs" server="example.foo.edu" user="*" path="%(USER)" mountpoint="/usagers/%(USER)" options="dir_
<cifsmount>/sbin/mount.cifs //%(SERVER)/%(VOLUME) %(MNTPT) -o "user=%(USER),uid=%(USERUID),gid=%(USERGID)%(before=\",\"
mount.cifs doesn't have anything to do with quotas. That's the purview of the kernel fs, which doesn't currently implement them.
Note that quotas are not enforced on the client, so you still get quota enforcement by the server regardless of the client. What's missing is the ability to query them, which would be a nice to have.
Thanks for the quick reply... sorry for posting in the wrong place.
(In reply to comment #0)
> On the client, the 'df' command reports total server filesystem usage and not
> the assigned user quota.
> On the server, we are using Samba-3.6.6 with filesystem quotas activated.
> Strangely, Windows (SMB-Samba client) and MacOS (AFP-Netatalk client) both
> report proper quota disk usage.
I attempted to reproduce this setup with the following
1) Setup quotas on a filesystem and export a share off it. Set quota for a user.
2) Mount the samba share using the username on a Linux server. Check df output. This shows the entire directory.
3) Next I use a Windows 2008 server and mount the same share. Map the drive as Z:. Right click and select properties. The free space shown here is for the entire filesystem as was seen in step 2.
I am not sure if I am doing this correctly.
Can you please confirm what windows version are you running and the steps you are taking to reproduce this problem.
Created attachment 8049 [details]
Windows 7 quota properties
Here is the properties windows for the share in question as seen with Windows 7 Enterprise.
On the server, the quota is identical:
[llalonde @fileserver~]$ quota -v
Quotas disque pour user llalonde (uid 12690) :
Système fichiers blocs quota limite sursisfichiers quota limite sursis
7493612 20000000 20400000 48511 0 0
And here's what I see on the Linux (Fedora 17) client with a home directory mounted using 'mount.cifs':
//fileserver.foobar.foo/llalonde 2,0T 808G 1,1T 44% /usagers/llalonde
And here's what I see on a MacOS client:
//firstname.lastname@example.org/llalonde 19Gi 7.1Gi 12Gi 37% 1873426 3226572 37% /usagers/llalonde
I suspect you are hitting the same problem described here
In this case, when using Posix extensions, the client uses the SMB_QUERY_POSIX_FS_INFO call which returns the disk stats and doesn't contain the disk quota. On the other hand, when not using the Posix extensions, ie. the Windows client or when mounted with nounix, the client uses the SMB_QUERY_FS_SIZE_INFO which includes the quota adjusted sizes.
In that particular bug, the conclusion was that values returned by both SMB_QUERY_POSIX_FS_INFO and SMB_QUERY_FS_SIZE_INFO should reflect the actual filesystem size and not the user quota. Quota information should be returned by a seperate quota interface which hasn't been implemented on the linux cifs client yet (see bz 6586).
However you should not have been able to see the user quota in Samba-3.6.6 so I may be wrong with the analysis above
To test if this is indeed the same issue, can you please attempt to mount on a Linux client with the nounix mount option and check to see if the df output reflects the users disk quota.
Ok, so I think that you've hit it on the nail...
Here's the mount with the unix extensions:
Sys. fich. Taille Util. Dispo Uti% Monté sur
//fileserver.foobar.foo/llalonde 2,0T 810G 1,1T 44% /usagers/llalonde
And here without the unix extensions(nounix):
Sys. fich. Taille Util. Dispo Uti% Monté sur
//fileserver.foobar.foo/llalonde 20G 7,2G 12G 38% /usagers/llalonde
Samba-3.6.6 still seems to still not provide the proper information...
For the moment, it looks that I'll still need to keep my script that checks network disk usage and sends a mail to the user when his home directory 95 percent full ;-<
Thanks for the confirmation. I am working on the quota interfaces for cifs.ko. Hopefully it will be ready soon and can be used for your purposes.
Great news! Keep me posted if you need a tester.
*** Bug 6586 has been marked as a duplicate of this bug. ***
*** Bug 10011 has been marked as a duplicate of this bug. ***
*** Bug 11050 has been marked as a duplicate of this bug. ***