filer: check scoped updates before preparing chunks

This commit is contained in:
Carlos Leyva committed 2026-11-24 22:11:06 +01:00
1 parent 7e5931ada6
commit cede961372
1 file changed
+5 -4
+5 -4
View File
@@ -1043,10 +1043,6 @@ func (fs *FilerServer) updateEntry(ctx context.Context, req *filer_pb.UpdateEntr
if refusal != nil {
return &filer_pb.UpdateEntryResponse{}, refusal
}
chunks, garbage, err := prepareChunks(ctx, fullpath, entry, req.Entry)
if err != nil {
return &filer_pb.UpdateEntryResponse{}, fmt.Errorf("UpdateEntry cleanupChunks %s: %w", fullpath, err)
}
if err := fs.checkScopeWorm(ctx, string(lockPath)); err != nil {
return &filer_pb.UpdateEntryResponse{}, err
}
@@ -1058,6 +1054,11 @@ func (fs *FilerServer) updateEntry(ctx context.Context, req *filer_pb.UpdateEntr
return &filer_pb.UpdateEntryResponse{}, err
}
chunks, garbage, err := prepareChunks(ctx, fullpath, entry, req.Entry)
if err != nil {
return &filer_pb.UpdateEntryResponse{}, fmt.Errorf("UpdateEntry cleanupChunks %s: %w", fullpath, err)
}
var newEntry *filer.Entry
var stamp int64
var unchanged bool