Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong quota-used-bytes returned for collections in LocalFs #15

Open
cgrenz opened this issue Mar 18, 2023 · 1 comment
Open

Wrong quota-used-bytes returned for collections in LocalFs #15

cgrenz opened this issue Mar 18, 2023 · 1 comment

Comments

@cgrenz
Copy link

cgrenz commented Mar 18, 2023

DavHandler uses the used space from DavFileSystem::get_quota() only on the root collection.

On every other resource DavMetaData::size() is used instead. On LocalFs that means that every subdirectory only reports an used space of around 4096 bytes (the size of the directory index).

RFC 4331 states:

The DAV:quota-used-bytes value is the value in octets representing
the amount of space used by this resource and possibly a number of
other similar resources, where the set of "similar" meets at least
the criterion that allocating space to any resource in the set will
count against the DAV:quota-available-bytes. It MUST include the
total count including usage derived from sub-resources if
appropriate. It SHOULD include metadata storage size if metadata
storage is counted against the DAV:quota-available-bytes.

So for collections it's more correct to re-use the used space from DavFileSystem::get_quota() instead of using DavMetaData::size(), as the size of a directory as reported by the OS doesn't include the sizes of contained files on usual file systems.

@Vigilans
Copy link
Contributor

Vigilans commented Apr 3, 2023

Actually fixed by miquels/webdav-handler-rs#11.

However there is no review nor comment from the author for two years.

If @messense would like to also maintain https://github.com/miquels/webdav-server-rs, I am happy to port all my fixes and features from original repo to here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants