Skip to content

NAS-140600 / 27.0.0-BETA.1 / NFSD: return ESTALE for snapdir entries when automount fails#247

Merged
ixhamza merged 1 commit intotruenas/linux-6.18from
nfsd-snapdir-automount-estale
Apr 8, 2026
Merged

NAS-140600 / 27.0.0-BETA.1 / NFSD: return ESTALE for snapdir entries when automount fails#247
ixhamza merged 1 commit intotruenas/linux-6.18from
nfsd-snapdir-automount-estale

Conversation

@ixhamza
Copy link
Copy Markdown
Member

@ixhamza ixhamza 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.

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>
@ixhamza ixhamza requested a review from anodos325 April 8, 2026 10:20
@ixhamza ixhamza added the jira label Apr 8, 2026
@bugclerk bugclerk changed the title NFSD: return ESTALE for snapdir entries when automount fails NAS-140600 / 27.0.0-BETA.1 / NFSD: return ESTALE for snapdir entries when automount fails Apr 8, 2026
@bugclerk
Copy link
Copy Markdown

bugclerk commented Apr 8, 2026

@ixhamza ixhamza requested review from bmeagherix and removed request for bmeagherix April 8, 2026 14:41
@ixhamza
Copy link
Copy Markdown
Member Author

ixhamza commented Apr 8, 2026

@ixhamza ixhamza merged commit 02bb5ee into truenas/linux-6.18 Apr 8, 2026
6 checks passed
@ixhamza
Copy link
Copy Markdown
Member Author

ixhamza commented Apr 8, 2026

time 8:00

@bugclerk
Copy link
Copy Markdown

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
@bugclerk
Copy link
Copy Markdown

bugclerk commented Apr 8, 2026

Time tracking added.

@ixhamza ixhamza deleted the nfsd-snapdir-automount-estale branch April 8, 2026 15:02
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants