[#7643] make smb backend quota aware
Summary make smb backend quota aware
Queue Horde Framework Packages
Queue Version Git master
Type Enhancement
State Rejected
Priority 1. Low
Owners jan@horde.org
Requester leena.heino@uta.fi
Created 2008-11-05 (4258 days ago)
Due
Updated 2016-01-28 (1618 days ago)
Assigned 2009-02-02 (4169 days ago)
Resolved 2016-01-28 (1618 days ago)
Milestone
Patch Yes

Comments
leena.heino@uta.fi 2008-11-05 17:43:52
It seems that smbclient produces something like this at the end of ls command:

  12765 blocks of size 262144. 42 blocks available



This seems to mean that user's hard quota is 12765 blocks and only 42 
of those blocks are currently free. Therefore current usage in bytes 
could be calculated as: (12765-42)*262144.

Chuck Hagenbuch <chuck@horde.org> 2008-11-06 04:47:56
I don't think I understand what you mean by this. That's just the 
usage; it's not a quota, and it may or may not be accurate (using 
sshfs, for example, the disk is always listed as having 1,000 GB 
available). So what would be gained by parsing it?

leena.heino@uta.fi 2008-11-06 10:00:26
> I don't think I understand what you mean by this. That's just the

> usage; it's not a quota, and it may or may not be accurate (using

> sshfs, for example, the disk is always listed as having 1,000 GB

> available). So what would be gained by parsing it?



We have EMC NS40 server as a NAS-server and it has a feature where the 
reported share size is the same as user quota. Therefore this line 
actually tells us in our system what is the user quota and disk usage. 
And each users home directory is a separate share. Each user can 
access their home directory as a with a share name "Home".



Is the samba default that it always reports for the share size the 
size of the whole disk or parent filesystem and as a usage the whole 
usage in the disk? If this is the case then parsing this line might be 
useless.



Anyway, I hacked together a very basic support to parsing the usage 
line and it seems to work in our system.



This revealed that gollem quota support is not configurable per user 
but per defined backend system.

Chuck Hagenbuch <chuck@horde.org> 2008-11-06 15:39:58
I'm not clear what the takeaway of your explorations is. Is this still 
something you want? Does it make sense to anyone else?

leena.heino@uta.fi 2008-11-06 18:35:59
> I'm not clear what the takeaway of your explorations is. Is this

> still something you want? Does it make sense to anyone else?



What I would like is:

- Make vfs quota support aware that different users might have 
different quota limits on different backends.

- Smb-driver should parse the disk usage information at the end of 
smbclient output.



Those things would enable me to offer our users the ability to check 
their disk quota and disk usage in gollem.



What I have already done is that I have made the smb vfs-driver parse 
the disk usage information at the end of smbclient output. This was 
done by adding the getFolderSize() to VFS/smb.php.



Could I achieve the first item in my wish list by calling setQuota() 
with suitable values within the VFS/smb.php file?



leena.heino@uta.fi 2008-11-06 19:34:19
> Could I achieve the first item in my wish list by calling setQuota()

> with suitable values within the VFS/smb.php file?



I solved this part by calling appropriate functions in VFS/smb.php. 
The code is not elegant, but works for my purposes.



Now I can offer to our users the ability to check their disk usage and 
their personal disk quota limit in the gollem. This has been a 
requested feature to gollem in my organization.

Chuck Hagenbuch <chuck@horde.org> 2008-11-07 01:35:55
> What I have already done is that I have made the smb vfs-driver parse

> the disk usage information at the end of smbclient output. This was

> done by adding the getFolderSize() to VFS/smb.php.



Do you want to contribute this?

leena.heino@uta.fi 2009-02-02 15:06:46
>> What I have already done is that I have made the smb vfs-driver parse

>> the disk usage information at the end of smbclient output. This was

>> done by adding the getFolderSize() to VFS/smb.php.

>

> Do you want to contribute this?



Attached.

Jan Schneider <jan@horde.org> 2012-11-27 11:30:06
Do you still use this? Can you provide an updated patch for Horde 5?

leena.heino@uta.fi 2012-11-27 12:10:42
> Do you still use this? Can you provide an updated patch for Horde 5?

We use this with in our framework_3 version. We would like to use it 
in H4 and H5, but I haven't had time to update the patch.

Updating the patch to H5 would mean at least replacing PEAR_ERROR with 
Horde_Vfs_Exception and using try and catch.

leena.heino@uta.fi 2012-11-27 14:11:10
Included updated patch to H4

leena.heino@uta.fi 2012-11-27 14:11:59
Included updated patch to H5


Jan Schneider <jan@horde.org> 2012-11-29 14:47:47
The patch (for H5, it's the only one that's going to be committed), 
doesn't pass the unit test. See the test that I committed to Git and 
remove the $this->markTestIncomplete() lines.

Jan Schneider <jan@horde.org> 2013-01-30 14:07:35
Ping?