Skip to content

NAS-141072 / 26.04 / Sync 6.12 with release branch#272

Merged
ixhamza merged 3 commits into
truenas/linux-6.12from
sync-6.12-with-release-branch
May 15, 2026
Merged

NAS-141072 / 26.04 / Sync 6.12 with release branch#272
ixhamza merged 3 commits into
truenas/linux-6.12from
sync-6.12-with-release-branch

Conversation

@ixhamza
Copy link
Copy Markdown
Member

@ixhamza ixhamza commented May 15, 2026

Since truenas/linux-6.12 was unmaintained, there were a couple of commits that are part of the release branch but not in truenas/linux-6.12. It was kind of a mess, but this should sync both.

amotin and others added 3 commits May 15, 2026 20:40
Original Linux code allocated memory on every link up and freed on
every link down.  It may be a problem to allocate several MBs of
physically contiguous memory on a running system.  To workaround
that, speculatively pre-allocate it on boot and then reallocate
only if remote host requests different parameters, which should
be very rare.

(cherry picked from commit 0852db2)
When nfsd_cross_mnt() crosses into a mounted ZFS snapshot but
rqst_exp_get_by_name() fails to resolve the sub-export (-ENOENT), the
error is silently converted to success and the automount stub dentry is
returned to the caller. The stub has simple_dir_operations and its file
handle is encoded with gen=1 (snapshot is mounted).

This 44-byte gen=1 handle becomes a permanent trap:
zfsctl_snapdir_vget() sees gen=1 matching d_mountpoint=true, returns the
stub inode, and READDIR returns NFS4_OK with zero entries. The client
caches this empty result indefinitely since there is no error signal to
trigger re-resolution. The empty directory persists until change_info4
updates (e.g., manual snapshot creation on the server).

For zfs_snapdir exports, return -ESTALE instead of silently falling back
to the automount stub. This causes the client to re-resolve via LOOKUP.

Signed-off-by: Ameer Hamza <ahamza@ixsystems.com>
(cherry picked from commit 3ab428e)
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)
@ixhamza ixhamza requested review from amotin and yocalebo May 15, 2026 15:50
@bugclerk bugclerk changed the title Sync 6.12 with release branch NAS-141072 / 26.04 / Sync 6.12 with release branch May 15, 2026
@bugclerk
Copy link
Copy Markdown

@truenas truenas deleted a comment from bugclerk May 15, 2026
@ixhamza ixhamza merged commit 53fe2b5 into truenas/linux-6.12 May 15, 2026
6 checks passed
@bugclerk
Copy link
Copy Markdown

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 May 15, 2026
@ixhamza
Copy link
Copy Markdown
Member Author

ixhamza commented May 15, 2026

time 00:20

@bugclerk
Copy link
Copy Markdown

Time tracking added.

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