Explorar el Código

manifest: Close archive once done using it

manifest code calls TarLayer() and gets archive. This archive needs to
be closed once caller is done using it to release the resrouces held
by archive. For the devicemapper graphdriver, archive keeps a device
mounted (device which is backing the layer). If archive.Close() is not
called, that device remains mounted and later deletion of device fails
leading to various other issues.

Signed-off-by: Vivek Goyal <vgoyal@redhat.com>
Vivek Goyal hace 10 años
padre
commit
41bfa87b6c
Se han modificado 1 ficheros con 2 adiciones y 0 borrados
  1. 2 0
      graph/manifest.go

+ 2 - 0
graph/manifest.go

@@ -73,6 +73,8 @@ func (s *TagStore) newManifest(localName, remoteName, tag string) ([]byte, error
 				return nil, err
 				return nil, err
 			}
 			}
 
 
+			defer archive.Close()
+
 			tarSum, err := tarsum.NewTarSum(archive, true, tarsum.Version1)
 			tarSum, err := tarsum.NewTarSum(archive, true, tarsum.Version1)
 			if err != nil {
 			if err != nil {
 				return nil, err
 				return nil, err