devmapper: cleanup some extraneous branching in setupBaseImage()

Docker-DCO-1.1-Signed-off-by: Mike Snitzer <snitzer@redhat.com> (github: snitm)
This commit is contained in:
Mike Snitzer 2014-11-21 22:26:09 -05:00
parent 553b50bd37
commit b9f1b0a751
1 changed files with 10 additions and 9 deletions

View File

@ -416,18 +416,19 @@ func (devices *DeviceSet) setupBaseImage() error {
} }
if devices.thinPoolDevice != "" && oldInfo == nil { if devices.thinPoolDevice != "" && oldInfo == nil {
if _, transactionId, dataUsed, _, _, _, err := devices.poolStatus(); err != nil { _, transactionId, dataUsed, _, _, _, err := devices.poolStatus()
if err != nil {
return err return err
} else { }
if dataUsed != 0 { if dataUsed != 0 {
return fmt.Errorf("Unable to take ownership of thin-pool (%s) that already has used data blocks", return fmt.Errorf("Unable to take ownership of thin-pool (%s) that already has used data blocks",
devices.thinPoolDevice) devices.thinPoolDevice)
} else if transactionId != 0 { }
if transactionId != 0 {
return fmt.Errorf("Unable to take ownership of thin-pool (%s) with non-zero transaction Id", return fmt.Errorf("Unable to take ownership of thin-pool (%s) with non-zero transaction Id",
devices.thinPoolDevice) devices.thinPoolDevice)
} }
} }
}
log.Debugf("Initializing base device-mapper thin volume") log.Debugf("Initializing base device-mapper thin volume")