Skip to content

Commit

Permalink
fix: don't ignore error on partition delete
Browse files Browse the repository at this point in the history
There is subtle issue with return code 'EBUSY' while myEntry is nil,
which might not fall through into this code to report an error
correctly.

Signed-off-by: Andrey Smirnov <[email protected]>
  • Loading branch information
smira committed Aug 20, 2024
1 parent 41240c1 commit c34dfb6
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions partitioning/gpt/gpt.go
Original file line number Diff line number Diff line change
Expand Up @@ -630,8 +630,10 @@ func (t *Table) syncKernel() error {
}

continue
case err != nil:
return fmt.Errorf("failed to delete partition %d: %w", no, err)
default:
if err != nil {
return fmt.Errorf("failed to delete partition %d: %w", no, err)
}
}

err = t.dev.KernelPartitionAdd(no,
Expand Down

0 comments on commit c34dfb6

Please sign in to comment.