Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Feb 8, 2026

Dmod_ReadDir() returns entry names (e.g., "dmclk"), not full paths. When recursing into subdirectories like /configs/dmclk/, the code passed "dmclk" directly to VFS operations, causing lookups for /dmclk instead of /configs/dmclk.

Changes

  • Construct absolute paths by joining config_path with entry names before passing to is_file(), read_driver_for_config(), and recursive calls
  • Add separator handling (only insert / when config_path doesn't already end with one)
  • Validate path length before construction to prevent overflow
  • Fix error log to use config_path parameter instead of ctx->config_path
// Before: passes relative path
int res = configure_drivers(ctx, driver_name, entry);  // entry = "dmclk"

// After: constructs and passes absolute path
char full_path[MAX_PATH_LENGTH];
Dmod_SnPrintf(full_path, sizeof(full_path), "%s%s%s", 
              config_path,                    // "/configs"
              needs_separator ? "/" : "",     // "/"
              entry);                         // "dmclk"
int res = configure_drivers(ctx, driver_name, full_path);  // "/configs/dmclk"
Original prompt

This section details on the original issue you should resolve

<issue_title>Niepoprawne iterowanie po katalogach w configure_drivers</issue_title>
<issue_description>W naszym scenariuszu mamy takie coś:

/ -> katalog root
/configs/ -> katalog z konfiguracjami przekazany do dmdevfs przy montowaniu
/configs/dmclk/ -> katalog z konfiguracjami dla drivera dmclk

I problem jest taki, że po tym jak dmdevfs znajdzie katalog configs, to w nim zaczyna szukac potem katalog /dmclk zamiast /configs/dmclk -> czyli uzywa sciezki wzglednej, zamiast bezwzglednej, przez co VFS zwraca informacje, ze takiego katalogu /dmclk nie ma i otrzymujemy komunikat:

[INFO] dmlist: Created list for module dmdevfs.
[INFO] Directory '/configs' opened successfully
dmdevfs: [ERROR] Failed to open config directory: /configs
dmdevfs: [ERROR] Failed to configure drivers in directory: dmclk

```</issue_description>

## Comments on the Issue (you are @copilot in this section)

<comments>
</comments>


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

… paths

Co-authored-by: JohnAmadis <17320783+JohnAmadis@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix incorrect directory iteration in configure_drivers Fix path construction in configure_drivers directory iteration Feb 8, 2026
Copilot AI requested a review from JohnAmadis February 8, 2026 13:54
@JohnAmadis JohnAmadis marked this pull request as ready for review February 8, 2026 14:03
@JohnAmadis JohnAmadis merged commit 490f7ef into main Feb 8, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Niepoprawne iterowanie po katalogach w configure_drivers

2 participants