mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
devmapper: Fix MountDevice for non-existing Device
Docker-DCO-1.1-Signed-off-by: Alexander Larsson <alexl@redhat.com> (github: alexlarsson)
This commit is contained in:
parent
304e33a2fe
commit
693d3f8c6a
1 changed files with 3 additions and 0 deletions
|
@ -804,6 +804,9 @@ func (devices *DeviceSet) MountDevice(hash, path string) error {
|
||||||
defer devices.Unlock()
|
defer devices.Unlock()
|
||||||
|
|
||||||
info := devices.Devices[hash]
|
info := devices.Devices[hash]
|
||||||
|
if info == nil {
|
||||||
|
return fmt.Errorf("Unknown device %s", hash)
|
||||||
|
}
|
||||||
|
|
||||||
if info.mountCount > 0 {
|
if info.mountCount > 0 {
|
||||||
if path != info.mountPath {
|
if path != info.mountPath {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue