Skip to content

NAS-140600 / 26.0.0-BETA.2 / NFSD: return ESTALE for snapdir entries when automount fails (by ixhamza)#249

Merged
yocalebo merged 1 commit intostable/26from
NAS-140600-26.0.0-BETA.2
Apr 8, 2026
Merged

NAS-140600 / 26.0.0-BETA.2 / NFSD: return ESTALE for snapdir entries when automount fails (by ixhamza)#249
yocalebo merged 1 commit intostable/26from
NAS-140600-26.0.0-BETA.2

Conversation

@bugclerk
Copy link
Copy Markdown

@bugclerk bugclerk commented Apr 8, 2026

When nfsd_cross_mnt() sets LOOKUP_AUTOMOUNT for a snapdir entry and follow_down() returns with the path unchanged, the automount was attempted and failed (EISDIR from zfsctl_snapshot_mount). The existing code treats this as "mountpoint in some other namespace" and returns success with the ctldir stub dentry. This stub has simple_dir_operations and produces a 44-byte file handle that returns empty READDIR (NFS4_OK, zero entries) with no error signal for the client to trigger re-resolution. This can happen transiently when zfs_suspend_fs races with mount helper after the z_teardown_lock deadlock fix (openzfs/zfs#18415)

Return ESTALE for snapdir entries so the client retries via LOOKUP, which re-triggers the automount.

Original PR: #247

When nfsd_cross_mnt() sets LOOKUP_AUTOMOUNT for a snapdir entry and
follow_down() returns with the path unchanged, the automount was
attempted and failed (EISDIR from zfsctl_snapshot_mount). The existing
code treats this as "mountpoint in some other namespace" and returns
success with the ctldir stub dentry.  This stub has
simple_dir_operations and produces a 44-byte file handle that returns
empty READDIR (NFS4_OK, zero entries) with no error signal for the
client to trigger re-resolution. This can happen transiently when
zfs_suspend_fs races with mount helper after the z_teardown_lock
deadlock fix (openzfs/zfs#18415)

Return ESTALE for snapdir entries so the client retries via LOOKUP,
which re-triggers the automount.

Signed-off-by: Ameer Hamza <ahamza@ixsystems.com>
(cherry picked from commit c026341)
@bugclerk
Copy link
Copy Markdown
Author

bugclerk commented Apr 8, 2026

@yocalebo yocalebo merged commit 987c44a into stable/26 Apr 8, 2026
2 checks passed
@yocalebo yocalebo deleted the NAS-140600-26.0.0-BETA.2 branch April 8, 2026 15:02
@bugclerk
Copy link
Copy Markdown
Author

bugclerk commented Apr 8, 2026

This PR has been merged and conversations have been locked.
If you would like to discuss more about this issue please use our forums or raise a Jira ticket.

@truenas truenas locked as resolved and limited conversation to collaborators Apr 8, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants