Browse code

Merge pull request #13536 from Mic92/master

remove redundant mount/unmount calls on commit

Jessie Frazelle authored on 2015/06/02 07:57:14
Showing 2 changed files
... ...
@@ -23,11 +23,6 @@ func (daemon *Daemon) Commit(container *Container, repository, tag, comment, aut
23 23
 		defer container.Unpause()
24 24
 	}
25 25
 
26
-	if err := container.Mount(); err != nil {
27
-		return nil, err
28
-	}
29
-	defer container.Unmount()
30
-
31 26
 	rwTar, err := container.ExportRw()
32 27
 	if err != nil {
33 28
 		return nil, err
... ...
@@ -838,20 +838,15 @@ func (container *Container) verifyDaemonSettings() {
838 838
 }
839 839
 
840 840
 func (container *Container) ExportRw() (archive.Archive, error) {
841
-	if err := container.Mount(); err != nil {
842
-		return nil, err
843
-	}
844 841
 	if container.daemon == nil {
845 842
 		return nil, fmt.Errorf("Can't load storage driver for unregistered container %s", container.ID)
846 843
 	}
847 844
 	archive, err := container.daemon.Diff(container)
848 845
 	if err != nil {
849
-		container.Unmount()
850 846
 		return nil, err
851 847
 	}
852 848
 	return ioutils.NewReadCloserWrapper(archive, func() error {
853 849
 			err := archive.Close()
854
-			container.Unmount()
855 850
 			return err
856 851
 		}),
857 852
 		nil