Skip to content

Commit

Permalink
fix: ForceUnlock should unlock everywhere (minio#12542)
Browse files Browse the repository at this point in the history
  • Loading branch information
harshavardhana authored Jun 22, 2021
1 parent 14bb969 commit bcea72e
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions cmd/admin-handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -415,21 +415,19 @@ func (a adminAPIHandlers) ForceUnlockHandler(w http.ResponseWriter, r *http.Requ
vars := mux.Vars(r)

var args dsync.LockArgs
lockersMap := make(map[string]dsync.NetLocker)
var lockers []dsync.NetLocker
for _, path := range strings.Split(vars["paths"], ",") {
if path == "" {
continue
}
args.Resources = append(args.Resources, path)
lockers, _ := z.serverPools[0].getHashedSet(path).getLockers()
for _, locker := range lockers {
if locker != nil {
lockersMap[locker.String()] = locker
}
}
}

for _, locker := range lockersMap {
for _, lks := range z.serverPools[0].erasureLockers {
lockers = append(lockers, lks...)
}

for _, locker := range lockers {
locker.ForceUnlock(ctx, args)
}
}
Expand Down

0 comments on commit bcea72e

Please sign in to comment.