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

@@ -161,11 +161,13 @@ func (wfs *WFS) Rename(cancel <-chan struct{}, in *fuse.RenameIn, oldName string
}
newPath := newDir.Child(newName)
if wfs.FilerConf != nil {
rule := wfs.FilerConf.MatchStorageRule(string(oldPath))
if rule.Worm {
return fuse.EPERM
}
oldEntry, status := wfs.maybeLoadEntry(oldPath)
if status != fuse.OK {
return status
}
if wormEnforced, _ := wfs.wormEnforcedForEntry(oldPath, oldEntry); wormEnforced {
return fuse.EPERM
}
glog.V(4).Infof("dir Rename %s => %s", oldPath, newPath)