Skip to content

Commit

Permalink
fix: ignore 'ENOENT' (no such file directory) on mount
Browse files Browse the repository at this point in the history
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 <smirnov.andrey@gmail.com>
  • Loading branch information
smira authored and talos-bot committed Mar 2, 2021
1 parent a241e9e commit 8ffb559
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions internal/pkg/mount/mount.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 8ffb559

Please sign in to comment.