forked from TrueCloudLab/frostfs-node
[#1175] core/object: Check emptiness of LOCK
members
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
parent
9feb5f9405
commit
98c84670e3
1 changed files with 6 additions and 1 deletions
|
@ -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 a new issue