file locking

Chris Lu
2026-03-24 09:31:46 -07:00
parent ec4ec60cfc
commit 579472f948
+16 -1
@@ -13,8 +13,23 @@ With "weed mount", the files can be operated as a local file. The following oper
* display free disk space
* copy file range
* lseek
* advisory file locking (`flock(2)` and POSIX `fcntl(2)` byte-range locks)
* extended attributes (xattr)
### Advisory File Locking
SeaweedFS supports advisory file locking over FUSE:
* whole-file locks via `flock(2)`
* POSIX byte-range locks via `fcntl(2)` (`F_SETLK`, `F_SETLKW`, `F_GETLK`)
The locks follow normal close semantics:
* POSIX `fcntl` locks are released when the closing lock owner closes the file
* `flock` locks are released with the file description close path
These are advisory locks, so applications must cooperate by taking and honoring them.
### Extended Attributes (xattr)
SeaweedFS supports POSIX extended attributes on files and directories via FUSE mount. You can use standard tools like `setfattr`, `getfattr`, and `xattr` to manage custom metadata.
@@ -365,4 +380,4 @@ From https://github.com/seaweedfs/seaweedfs/issues/877
Workaround is to use Linux capabilities on weed executable.
setcap cap_net_raw,cap_net_admin,cap_dac_override+eip /usr/local/bin/weed
After that you need to use "weed mount" with option allowOthers=false
```
```