locks: correctly mark updates to the layers list

When saving the layers list, mark the list as having been updated by us.
Broken since 0183a293dc.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
This commit is contained in:
Nalin Dahyabhai 2019-05-08 11:20:05 -04:00
parent 9a4328ef7c
commit b1822634c0
1 changed files with 1 additions and 3 deletions

View File

@ -402,12 +402,10 @@ func (r *layerStore) Save() error {
if err != nil { if err != nil {
return err return err
} }
defer r.Touch()
if err := ioutils.AtomicWriteFile(rpath, jldata, 0600); err != nil { if err := ioutils.AtomicWriteFile(rpath, jldata, 0600); err != nil {
return err return err
} }
if !r.IsReadWrite() {
return nil
}
r.mountsLockfile.Lock() r.mountsLockfile.Lock()
defer r.mountsLockfile.Unlock() defer r.mountsLockfile.Unlock()
defer r.mountsLockfile.Touch() defer r.mountsLockfile.Touch()