storage: locking support
butonic opened this issue · comments
Currently there is no locking support. The CS3 apis should allow implementing locking functionality for eg webdav or s3.
Hm... I am not totally convinced by this (maybe we should explain the rationale behind some of the APIs better in the documentation). Could you please explain the use-case?
WebDAV spec: https://tools.ietf.org/html/rfc4918#section-6 used by eg
- ms office tries to lock files: http://sabre.io/dav/clients/msoffice/
- wopi api needs locking owncloud/core#31651
- oc pr introducing hard locks owncloud/core#31651
- box api has locking: https://developer.box.com/reference#lock-and-unlock
- s3 object locks: https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lock.html
- posix fcntl description http://pubs.opengroup.org/onlinepubs/9699919799/functions/fcntl.html
Now, for network filesystems locking is non trivial:
- On the brokenness of locking in linux by Lennart Poettering: http://0pointer.de/blog/projects/locking.html
- Samba also has an opinion on locking in https://www.samba.org/samba/news/articles/low_point/tale_two_stds_os2.html
I am happy to discuss if we want to store locks in a different place than the storage. However, I think just like search, tagging, comments, trash and versions ... locking might be implemented by a storage provider.
The cernsbox wopiserver uses lock files to implement locks on top of cs3. A dedicated RPC should make this clearer.