Bug 499397 - [CIFS] Share-level (or folder-level) quota not handled
[CIFS] Share-level (or folder-level) quota not handled
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: kernel (Show other bugs)
All Linux
low Severity medium
: rc
: ---
Assigned To: Jeff Layton
Red Hat Kernel QE team
Depends On:
Blocks: 533192
  Show dependency treegraph
Reported: 2009-05-06 10:19 EDT by Sachin Prabhu
Modified: 2014-06-18 03:38 EDT (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2010-01-13 08:28:33 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
tcpdump with Windows client (3.88 KB, application/octet-stream)
2009-05-06 10:30 EDT, Sachin Prabhu
no flags Details

  None (edit)
Description Sachin Prabhu 2009-05-06 10:19:51 EDT
For shares exported with share-level/folder level quotas on a Windows 2003 R2  server, the df command reports the size of the total used/free space on the filesystem instead of the effective disk space for the share.

Steps to Reproduce:
- Create partition Windows 2003 R2 (<-- !!! "R2" IS IMPORTANT. NOT TO CONFUSE WITH "SP2" !!!) fileserver e.g. size 1GB
- Create folder on newly created partition
- Enable folder quota on newly created folder e.g. size 100MB
- Export folder from Server
- Mount share with RHEL5 Client via cifs
- Call "df" on the mountpoint

Actual results:
You see the filesystem size of the share (here 1GB), not the quota size.

Expected results:
You should see the effective size (the quota size) (100MB) as seen on Windows clients.

Additional info:

The windows client uses
QUERY_FS_INFO with level of interest "Query Full FS Size Info"
which returns "Allocation Size", "Caller Free Units", "Actual Free Units".

The RHEL5 Client (cifs-sharelevel-quota-rhelclient.pcap) uses
QUERY_FS_INFO with level of Interest "Query FS Size Info"
which only returns "Allocation Size", "Free Units". Both of this values
doesn't reflect the defined quota.

As I saw in the kernel source code (RedHat Source-RPM) the "Level of Interest"
is defined, but never used

#define SMB_QUERY_FS_SIZE_INFO      0x103

int CIFSSMBQFSInfo(const int xid, struct cifsTconInfo *tcon, struct kstatfs *FSData)
       pSMB->InformationLevel = cpu_to_le16(SMB_QUERY_FS_SIZE_INFO);

This is similar to the code seen in the upstream kernel tree.
Comment 2 Sachin Prabhu 2009-05-06 10:30:11 EDT
Created attachment 342663 [details]
tcpdump with Windows client
Comment 3 Jeff Layton 2009-07-22 11:07:25 EDT
I've had a bit of a chance to look at this...

SMB_QUERY_FS_FULL_SIZE_INFO is a passthrough infolevel, so we'll need to make sure that we don't regress when talking to older servers that may not support that call (I've got a win98se image that I can test against).

The code may need to fall back to the current call if the new call doesn't work against a particular server.
Comment 4 Jeff Layton 2009-07-22 15:08:04 EDT
Adding Steve French, the upstream maintainer for CIFS...

This looks doable, but I'm trying to determine if this is correct behavior. Why should we have statfs take quotas into account? Having statfs return different info for different users sounds confusing (I assume that different users get different values here? Is that correct?).
Comment 6 Jeff Layton 2010-01-13 08:27:36 EST
Too late for 5.5 anyway...

Been a while since I've revisited this one, but I'm inclined to NAK this BZ altogether and suggest that it instead be turned into a feature request to fix up quota handling for CIFS. It seems to me that statfs info ought to show global information about the share, and that info on quotas is better presented via the quota tools.

On that, I'm going to devel_nak this BZ for 5.6. Please reopen it as a feature request if you wish to pursue implementing the quota interfaces in CIFS.
Comment 7 RHEL Product and Program Management 2010-01-13 08:28:33 EST
Development Management has reviewed and declined this request.  You may appeal
this decision by reopening this request.

Note You need to log in before you can comment on or make changes to this bug.