From 8ffb55943c71a100c0b1fd53c5520b2cf3ec72b8 Mon Sep 17 00:00:00 2001 From: Andrey Smirnov Date: Tue, 2 Mar 2021 21:36:59 +0300 Subject: [PATCH] fix: ignore 'ENOENT' (no such file directory) on mount This fixes a race condition between `udevd` issuing ioctl `BLKRRPART` when block device is closed after partitioning/formatting and Talos trying to mount a partition. When `BLKRRPART` is issued, kernel temporarily wipes out all the in-memory partitions killing `/dev/sdX` devices until partition scan is done. Signed-off-by: Andrey Smirnov --- internal/pkg/mount/mount.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/internal/pkg/mount/mount.go b/internal/pkg/mount/mount.go index 8da023652..cb13c0aa1 100644 --- a/internal/pkg/mount/mount.go +++ b/internal/pkg/mount/mount.go @@ -134,6 +134,9 @@ func mountRetry(f RetryFunc, p *Point, isUnmount bool) (err error) { switch err { case unix.EBUSY: return retry.ExpectedError(err) + case unix.ENOENT: + // if udevd triggers BLKRRPART ioctl, partition device entry might disappear temporarily + return retry.ExpectedError(err) case unix.EINVAL: isMounted, checkErr := p.IsMounted() if checkErr != nil {