mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2025-09-23 01:23:36 +08:00
worm grace period and retention time support (#6404)
Signed-off-by: lou <alex1988@outlook.com>
This commit is contained in:
@@ -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)
|
||||
|
Reference in New Issue
Block a user