update locks

This commit is contained in:
shoopea
2025-10-19 14:12:31 +02:00
parent ace13b68a8
commit 73f9551c8f
6 changed files with 75 additions and 37 deletions

View File

@@ -97,8 +97,8 @@ func (a Addr) SetManaged(managed bool) error {
log.WithFields(log.Fields{"addr": a, "path": a.Path(), "error": err}).Errorf("")
return err
} else {
fs.mx.Lock()
defer fs.mx.Unlock()
fs.Lock()
defer fs.Unlock()
if fs.managed != managed {
var cmd string
if managed {
@@ -129,8 +129,8 @@ func (a Addr) SetBackedUp(val bool) error {
log.WithFields(log.Fields{"addr": a, "path": a.Path(), "error": err}).Errorf("")
return err
} else {
fs.mx.Lock()
defer fs.mx.Unlock()
fs.Lock()
defer fs.Unlock()
fs.backedUp = val
return nil
}