[#1175] core/object: Check emptiness of `LOCK` members
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>remotes/fyrchik/fix-lock
parent
9feb5f9405
commit
98c84670e3
|
@ -227,8 +227,13 @@ func (v *FormatValidator) ValidateContent(o *object.Object) error {
|
||||||
}
|
}
|
||||||
|
|
||||||
if v.locker != nil {
|
if v.locker != nil {
|
||||||
|
num := lock.NumberOfMembers()
|
||||||
|
if num == 0 {
|
||||||
|
return errors.New("missing locked members")
|
||||||
|
}
|
||||||
|
|
||||||
// mark all objects from lock list as locked in storage engine
|
// mark all objects from lock list as locked in storage engine
|
||||||
locklist := make([]oid.ID, lock.NumberOfMembers())
|
locklist := make([]oid.ID, num)
|
||||||
lock.ReadMembers(locklist)
|
lock.ReadMembers(locklist)
|
||||||
|
|
||||||
err = v.locker.Lock(*o.ContainerID(), *o.ID(), locklist)
|
err = v.locker.Lock(*o.ContainerID(), *o.ID(), locklist)
|
||||||
|
|
Loading…
Reference in New Issue