persist readonly state to volume info (#5977)

This commit is contained in:
Bruce
2024-09-05 22:58:24 +08:00
committed by GitHub
parent 310d41998d
commit f9e141a412
5 changed files with 525 additions and 499 deletions

View File

@@ -477,6 +477,7 @@ func (s *Store) MarkVolumeReadonly(i needle.VolumeId) error {
}
v.noWriteLock.Lock()
v.noWriteOrDelete = true
v.PersistReadOnly(true)
v.noWriteLock.Unlock()
return nil
}
@@ -488,6 +489,7 @@ func (s *Store) MarkVolumeWritable(i needle.VolumeId) error {
}
v.noWriteLock.Lock()
v.noWriteOrDelete = false
v.PersistReadOnly(false)
v.noWriteLock.Unlock()
return nil
}