Skip to content

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

@cgrenz

Description

@cgrenz

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions