From 7225460a68dfe5dd886bc182e564ced6d92b7d61 Mon Sep 17 00:00:00 2001 From: Qian Cai Date: Tue, 15 Sep 2020 09:06:06 -0400 Subject: [PATCH] shimv2: add a comment in checkAndMount() In checkAndMount(), it is not clear why we check IsBlockDevice() and if DisableBlockDeviceUse == false and then only return "false, nil" instead of "false, err". Adding a comment to make it a bit more readable. Fixes: #732 Signed-off-by: Qian Cai --- src/runtime/containerd-shim-v2/create.go | 1 + 1 file changed, 1 insertion(+) diff --git a/src/runtime/containerd-shim-v2/create.go b/src/runtime/containerd-shim-v2/create.go index f982e62dd1..87fddcba7f 100644 --- a/src/runtime/containerd-shim-v2/create.go +++ b/src/runtime/containerd-shim-v2/create.go @@ -179,6 +179,7 @@ func checkAndMount(s *service, r *taskAPI.CreateTaskRequest) (bool, error) { if len(r.Rootfs) == 1 { m := r.Rootfs[0] + // Plug the block backed rootfs directly instead of mounting it. if katautils.IsBlockDevice(m.Source) && !s.config.HypervisorConfig.DisableBlockDeviceUse { return false, nil }