Merge pull request #8858 from rainzm/fix/disk_resize

fix(hostdeployer): umount rootfs before resize partition
This commit is contained in:
Zexi Li
2020-11-18 21:13:33 +08:00
committed by GitHub
@@ -120,18 +120,14 @@ func (*DeployerServer) ResizeFs(ctx context.Context, req *deployapi.ResizeFsPara
}
root := disk.MountRootfs()
defer disk.UmountRootfs(root)
if root == nil {
err := disk.ResizePartition()
return new(deployapi.Empty), err
} else {
if !root.IsResizeFsPartitionSupport() {
return new(deployapi.Empty), errors.ErrNotSupported
} else {
err := disk.ResizePartition()
return new(deployapi.Empty), err
}
if root != nil && !root.IsResizeFsPartitionSupport() {
return new(deployapi.Empty), errors.ErrNotSupported
}
// must umount rootfs before resize partition
disk.UmountRootfs(root)
err = disk.ResizePartition()
return new(deployapi.Empty), err
}
func (*DeployerServer) FormatFs(ctx context.Context, req *deployapi.FormatFsParams) (*deployapi.Empty, error) {