worm grace period and retention time support (#6404)

Signed-off-by: lou <alex1988@outlook.com>
This commit is contained in:
Guang Jiong Lou
2025-01-01 10:41:43 +08:00
committed by GitHub
parent 0e8e6122d5
commit 3b1ac77e1f
14 changed files with 831 additions and 707 deletions

View File

@@ -11,7 +11,7 @@ func (wfs *WFS) AcquireHandle(inode uint64, flags, uid, gid uint32) (fileHandle
var path util.FullPath
path, _, entry, status = wfs.maybeReadEntry(inode)
if status == fuse.OK {
if wfs.wormEnabledForEntry(path, entry) && flags&fuse.O_ANYWRITE != 0 {
if wormEnforced, _ := wfs.wormEnforcedForEntry(path, entry); wormEnforced && flags&fuse.O_ANYWRITE != 0 {
return nil, fuse.EPERM
}
// need to AcquireFileHandle again to ensure correct handle counter