diff --git a/daemon/commit.go b/daemon/commit.go index 8f975cc0fa..9ee249b690 100644 --- a/daemon/commit.go +++ b/daemon/commit.go @@ -23,11 +23,6 @@ func (daemon *Daemon) Commit(container *Container, repository, tag, comment, aut defer container.Unpause() } - if err := container.Mount(); err != nil { - return nil, err - } - defer container.Unmount() - rwTar, err := container.ExportRw() if err != nil { return nil, err diff --git a/daemon/container_linux.go b/daemon/container_linux.go index 47ec7a16c7..6f1aa3ef01 100644 --- a/daemon/container_linux.go +++ b/daemon/container_linux.go @@ -838,20 +838,15 @@ func (container *Container) verifyDaemonSettings() { } func (container *Container) ExportRw() (archive.Archive, error) { - if err := container.Mount(); err != nil { - return nil, err - } if container.daemon == nil { return nil, fmt.Errorf("Can't load storage driver for unregistered container %s", container.ID) } archive, err := container.daemon.Diff(container) if err != nil { - container.Unmount() return nil, err } return ioutils.NewReadCloserWrapper(archive, func() error { err := archive.Close() - container.Unmount() return err }), nil