diff --git a/tsc/internal/fswatch/fanotify_linux.go b/tsc/internal/fswatch/fanotify_linux.go index 1e4200afda52e..692ac38ccee5e 100644 --- a/tsc/internal/fswatch/fanotify_linux.go +++ b/tsc/internal/fswatch/fanotify_linux.go @@ -370,7 +370,7 @@ func (b *fanotifyBackend) markDir(w *dirWatch, path string, markPath string) err } func maybeWrapUnsupportedFilesystem(err error) error { - if errors.Is(err, unix.EOPNOTSUPP) || errors.Is(err, unix.ENOTSUP) || errors.Is(err, unix.ENODEV) { + if errors.Is(err, unix.EOPNOTSUPP) || errors.Is(err, unix.ENOTSUP) || errors.Is(err, unix.ENODEV) || errors.Is(err, unix.EXDEV) { return fmt.Errorf("%w: %w", err, ErrFilesystemUnsupported) } return err diff --git a/tsc/internal/fswatch/fanotify_linux_test.go b/tsc/internal/fswatch/fanotify_linux_test.go index 7dfe9f5825bbb..0bf7672c36754 100644 --- a/tsc/internal/fswatch/fanotify_linux_test.go +++ b/tsc/internal/fswatch/fanotify_linux_test.go @@ -127,13 +127,15 @@ func TestLinuxFanotifyMaybeWrapUnsupportedFilesystem(t *testing.T) { // Errnos that indicate the filesystem cannot support fanotify FID-based // watching are tagged with ErrFilesystemUnsupported so higher layers can // fall back to inotify (issue #63646). - for _, errno := range []error{unix.EOPNOTSUPP, unix.ENODEV} { - wrapped := maybeWrapUnsupportedFilesystem(fmt.Errorf("name_to_handle_at: %w", errno)) - if !errors.Is(wrapped, ErrFilesystemUnsupported) { - t.Errorf("expected %v to be tagged ErrFilesystemUnsupported", errno) - } - if !errors.Is(wrapped, errno) { - t.Errorf("expected wrapped error to still unwrap to %v", errno) + for _, errno := range []error{unix.EOPNOTSUPP, unix.ENODEV, unix.EXDEV} { + for _, err := range []error{errno, fmt.Errorf("name_to_handle_at: %w", errno)} { + wrapped := maybeWrapUnsupportedFilesystem(err) + if !errors.Is(wrapped, ErrFilesystemUnsupported) { + t.Errorf("expected %v to be tagged ErrFilesystemUnsupported", err) + } + if !errors.Is(wrapped, errno) { + t.Errorf("expected wrapped error to still unwrap to %v", errno) + } } }