Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions config.js
Original file line number Diff line number Diff line change
Expand Up @@ -1013,6 +1013,8 @@ config.NFSF_UPLOAD_STREAM_MEM_THRESHOLD = 8 * 1024 * 1024;

// we want to change our handling related to EACCESS error
config.NSFS_LIST_IGNORE_ENTRY_ON_EACCES = true;
// we will for now handle the same way also EINVAL error - for gpfs stat issues on list (.snapshots)
config.NSFS_LIST_IGNORE_ENTRY_ON_EINVAL = true;
Comment on lines +1016 to +1017

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Consider narrowing the scope of EINVAL error suppression.

The global flag unconditionally ignores all EINVAL errors during list operations. EINVAL is a generic error code that could indicate various legitimate issues beyond GPFS internal directories. The "for now" comment suggests this is a temporary workaround.

Consider these alternatives:

  • Add path-based filtering (e.g., only ignore EINVAL for paths matching .snapshots or other known GPFS internal directories)
  • Make the config controllable via environment variable for easier debugging
  • Add more detailed logging when EINVAL is encountered to track if it's masking unexpected issues

Would you like me to generate a more targeted implementation that checks path patterns before ignoring EINVAL errors?

🤖 Prompt for AI Agents
In config.js around lines 1016-1017 the current global flag
NSFS_LIST_IGNORE_ENTRY_ON_EINVAL unconditionally suppresses all EINVAL errors;
narrow this by replacing the global boolean with a scoped policy: implement
path-based filtering so EINVAL is ignored only for known GPFS internal paths
(e.g., entries matching `.snapshots` or configurable patterns), make the
behavior toggleable via an environment variable (e.g.,
NSFS_LIST_IGNORE_ENTRY_ON_EINVAL_PATTERNS or a boolean plus pattern list) and
ensure list operation code logs detailed context (path, error stack/message and
whether it was suppressed) when an EINVAL occurs so unexpected cases are visible
for debugging.


////////////////////////////
// NSFS NON CONTAINERIZED //
Expand Down
2 changes: 2 additions & 0 deletions src/util/native_fs_utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,8 @@ async function stat_if_exists(fs_context, entry_path, use_lstat, should_ignore_e
// we might want to expand the error list due to permission/structure
// change (for example: ELOOP, ENAMETOOLONG) or other reason (EPERM) - need to be decided
if ((err.code === 'EACCES' && should_ignore_eacces) ||
// A fix for GPFS stat issues on list (.snapshots) - ignore EINVAL as well
(err.code === 'EINVAL' && config.NSFS_LIST_IGNORE_ENTRY_ON_EINVAL) ||
err.code === 'ENOENT' || err.code === 'ENOTDIR') {
dbg.log0('stat_if_exists: Could not access file entry_path',
entry_path, 'error code', err.code, ', skipping...');
Expand Down