Skip to content

Commit 5cab0d3

Browse files
author
fesu
committed
update the max if cur will be greater than max for setting the limit
Signed-off-by: Su Fei <[email protected]>
1 parent 4a2f61c commit 5cab0d3

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

cmd/containerd-stress/rlimit_unix.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@ func setRlimit() error {
3131
}
3232
if limit.Cur < rlimit {
3333
limit.Cur = rlimit
34+
if limit.Max < limit.Cur {
35+
limit.Max = limit.Cur
36+
}
3437
if err := syscall.Setrlimit(syscall.RLIMIT_NOFILE, &limit); err != nil {
3538
return err
3639
}

0 commit comments

Comments
 (0)