pkg/devicemapper: defer udev wait during removal
Signed-off-by: Vincent Batts <vbatts@redhat.com>
This commit is contained in:
parent
7f1cdd81f0
commit
3bce14e7d0
1 changed files with 4 additions and 4 deletions
|
@ -307,7 +307,9 @@ func RemoveDevice(name string) error {
|
|||
if err := task.SetCookie(&cookie, 0); err != nil {
|
||||
return fmt.Errorf("Can not set cookie: %s", err)
|
||||
}
|
||||
defer UdevWait(cookie)
|
||||
|
||||
dmSawBusy = false // reset before the task is run
|
||||
if err = task.Run(); err != nil {
|
||||
if dmSawBusy {
|
||||
return ErrBusy
|
||||
|
@ -315,8 +317,6 @@ func RemoveDevice(name string) error {
|
|||
return fmt.Errorf("Error running RemoveDevice %s", err)
|
||||
}
|
||||
|
||||
UdevWait(cookie)
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
|
@ -543,7 +543,7 @@ func CreateDevice(poolName string, deviceId *int) error {
|
|||
return fmt.Errorf("Can't set message %s", err)
|
||||
}
|
||||
|
||||
dmSawExist = false
|
||||
dmSawExist = false // reset before the task is run
|
||||
if err := task.Run(); err != nil {
|
||||
if dmSawExist {
|
||||
// Already exists, try next id
|
||||
|
@ -638,7 +638,7 @@ func CreateSnapDevice(poolName string, deviceId *int, baseName string, baseDevic
|
|||
return fmt.Errorf("Can't set message %s", err)
|
||||
}
|
||||
|
||||
dmSawExist = false
|
||||
dmSawExist = false // reset before the task is run
|
||||
if err := task.Run(); err != nil {
|
||||
if dmSawExist {
|
||||
// Already exists, try next id
|
||||
|
|
Loading…
Reference in a new issue