Skip to content

Commit

Permalink
Merge pull request #5111 from ctrlaltdel121/master
Browse files Browse the repository at this point in the history
mark device faulty after parent fails to suspend
  • Loading branch information
crosbymichael committed Mar 8, 2021
2 parents da137a7 + 51a72f0 commit 7738246
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions snapshots/devmapper/pool_device.go
Original file line number Diff line number Diff line change
Expand Up @@ -331,12 +331,6 @@ func (p *PoolDevice) CreateSnapshotDevice(ctx context.Context, deviceName string
}
}()

// Save snapshot metadata and allocate new device ID
metaErr = p.metadata.AddDevice(ctx, snapInfo)
if metaErr != nil {
return metaErr
}

// The base device must be suspend before taking a snapshot to
// avoid corruption.
// https://github.com/torvalds/linux/blob/v5.7/Documentation/admin-guide/device-mapper/thin-provisioning.rst#internal-snapshots
Expand All @@ -354,6 +348,12 @@ func (p *PoolDevice) CreateSnapshotDevice(ctx context.Context, deviceName string
}()
}

// Save snapshot metadata and allocate new device ID
metaErr = p.metadata.AddDevice(ctx, snapInfo)
if metaErr != nil {
return metaErr
}

// Create thin device snapshot
devErr = p.createSnapshot(ctx, baseInfo, snapInfo)
if devErr != nil {
Expand Down

0 comments on commit 7738246

Please sign in to comment.