From 3aad09be281aa69ed14cfffb07ccf97db60ce636 Mon Sep 17 00:00:00 2001 From: Anis Elleuch Date: Tue, 2 Jun 2020 17:07:16 +0100 Subject: [PATCH] heal: Fix passing healing opts (#9756) Manual healing (as background healing) creates a heal task with a possiblity to override healing options, such as deep or normal mode. Use a pointer type in heal opts so nil would mean use the default healing options. --- cmd/admin-heal-ops.go | 8 ++++---- cmd/global-heal.go | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/cmd/admin-heal-ops.go b/cmd/admin-heal-ops.go index 9a10b3187..c3fd34bef 100644 --- a/cmd/admin-heal-ops.go +++ b/cmd/admin-heal-ops.go @@ -296,8 +296,8 @@ func (ahs *allHealState) PopHealStatusJSON(path string, // healSource denotes single entity and heal option. type healSource struct { - path string // entity path (format, buckets, objects) to heal - opts madmin.HealOpts // optional heal option overrides default setting + path string // entity path (format, buckets, objects) to heal + opts *madmin.HealOpts // optional heal option overrides default setting } // healSequence - state for each heal sequence initiated on the @@ -622,8 +622,8 @@ func (h *healSequence) queueHealTask(source healSource, healType madmin.HealItem opts: h.settings, responseCh: h.respCh, } - if !source.opts.Equal(h.settings) { - task.opts = source.opts + if source.opts != nil { + task.opts = *source.opts } globalBackgroundHealRoutine.queueHealTask(task) diff --git a/cmd/global-heal.go b/cmd/global-heal.go index 0d09c2d2c..c8c7ed7c0 100644 --- a/cmd/global-heal.go +++ b/cmd/global-heal.go @@ -128,7 +128,7 @@ func deepHealObject(objectPath string) { bgSeq.sourceCh <- healSource{ path: objectPath, - opts: madmin.HealOpts{ScanMode: madmin.HealDeepScan}, + opts: &madmin.HealOpts{ScanMode: madmin.HealDeepScan}, } }