Bug 9281 - cifs kernel client not reporting quotas
Summary: cifs kernel client not reporting quotas
Status: NEW
Alias: None
Product: CifsVFS
Classification: Unclassified
Component: kernel fs (show other bugs)
Version: 2.6
Hardware: All Linux
: P5 normal
Target Milestone: ---
Assignee: Steve French
QA Contact: cifs QA contact
URL:
Keywords:
: 6586 10011 11050 (view as bug list)
Depends on: 5395
Blocks:
  Show dependency treegraph
 
Reported: 2012-10-10 16:38 UTC by Luc Lalonde
Modified: 2020-07-16 00:12 UTC (History)
6 users (show)

See Also:


Attachments
Windows 7 quota properties (70.32 KB, image/jpeg)
2012-10-12 15:28 UTC, Luc Lalonde
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Luc Lalonde 2012-10-10 16:38:03 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_
mode=0700,file_mode=0600,serverino,nobrl,sec=ntlm" />

<cifsmount>/sbin/mount.cifs //%(SERVER)/%(VOLUME) %(MNTPT) -o "user=%(USER),uid=%(USERUID),gid=%(USERGID)%(before=\",\" 
OPTIONS)"</cifsmount>
Comment 1 Jeff Layton 2012-10-10 16:43:25 UTC
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.
Comment 2 Luc Lalonde 2012-10-10 16:52:01 UTC
Thanks for the quick reply...  sorry for posting in the wrong place.
Comment 3 Sachin Prabhu 2012-10-12 14:07:44 UTC
(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.


Luc,

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.

Sachin Prabhu
Comment 4 Luc Lalonde 2012-10-12 15:28:31 UTC
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
/dev/mapper/store-homes
                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:

//llalonde@fileserver.foobar.foo/llalonde   19Gi  7.1Gi   12Gi    37%  1873426   3226572   37%   /usagers/llalonde
Comment 5 Sachin Prabhu 2012-10-12 15:37:36 UTC
I suspect you are hitting the same problem described here
https://bugzilla.samba.org/show_bug.cgi?id=5395

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
https://bugzilla.samba.org/show_bug.cgi?id=5395#c12

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.
Comment 6 Luc Lalonde 2012-10-12 17:36:34 UTC
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 ;-<
Comment 7 Sachin Prabhu 2012-10-12 17:56:21 UTC
Luc,

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.

Sachin Prabhu
Comment 8 Luc Lalonde 2012-10-12 18:03:00 UTC
Great news!  Keep me posted if you need a tester.
Comment 9 Björn Jacke 2014-11-06 13:00:17 UTC
*** Bug 6586 has been marked as a duplicate of this bug. ***
Comment 10 Björn Jacke 2014-11-06 13:11:22 UTC
*** Bug 10011 has been marked as a duplicate of this bug. ***
Comment 11 Björn Jacke 2015-01-14 11:57:28 UTC
*** Bug 11050 has been marked as a duplicate of this bug. ***