Skip to content

Commit 480126f

Browse files
hsiangkaok8s-infra-cherrypick-robot
authored andcommitted
erofs-snapshotter: fix to work with wrapped errors
Commit fb6dd2c ("client:improve mount error message") changed the return value into a wraped error message, which causes the ENOTBLK check doesn't work. Reported-by: Aadhar Agarwal <[email protected]> Fixes: #11861 Signed-off-by: Gao Xiang <[email protected]>
1 parent 9966095 commit 480126f

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

plugins/snapshots/erofs/erofs_linux.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ package erofs
1919
import (
2020
"bytes"
2121
"context"
22+
"errors"
2223
"fmt"
2324
"os"
2425
"path/filepath"
@@ -265,7 +266,7 @@ func (s *snapshotter) mounts(snap storage.Snapshot, info snapshots.Info) ([]moun
265266
if mntpoint != m.Source && !isErofs(mntpoint) {
266267
err := m.Mount(mntpoint)
267268
// Use loop if the current kernel (6.12+) doesn't support file-backed mount
268-
if err == unix.ENOTBLK {
269+
if errors.Is(err, unix.ENOTBLK) {
269270
m.Options = append(m.Options, "loop")
270271
err = m.Mount(mntpoint)
271272
}

0 commit comments

Comments
 (0)