From bfac55e6c080ec39f83eb9f9e41efb3edfe01545 Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Wed, 11 Aug 2021 22:22:49 -0700 Subject: [PATCH] avoid integer overflow fix https://github.com/chrislusf/seaweedfs/issues/2254 --- weed/filer/filer_remote_storage.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/weed/filer/filer_remote_storage.go b/weed/filer/filer_remote_storage.go index f09658015..99ea1d3bb 100644 --- a/weed/filer/filer_remote_storage.go +++ b/weed/filer/filer_remote_storage.go @@ -35,7 +35,9 @@ func NewFilerRemoteStorage() (rs *FilerRemoteStorage) { func (rs *FilerRemoteStorage) LoadRemoteStorageConfigurationsAndMapping(filer *Filer) (err error) { // execute this on filer - entries, _, err := filer.ListDirectoryEntries(context.Background(), DirectoryEtcRemote, "", false, math.MaxInt64, "", "", "") + limit := int64(math.MaxInt32) + + entries, _, err := filer.ListDirectoryEntries(context.Background(), DirectoryEtcRemote, "", false, limit, "", "", "") if err != nil { if err == filer_pb.ErrNotFound { return nil