Re: [PATCH] smb: client: convert DFS target node name from cache charset on mount
From: Paulo Alcantara
Date: Thu Nov 26 2026 - 07:15:33 EST
Fredric Cover <fredric.cover.lkernel@xxxxxxxxx> writes:
> parse_dfs_target() converts @path_consumed to the mount charset using
> dfs_consumed_to_local(), but @ref->node_name from the DFS referral cache
> is still encoded in UTF-8 (cache_cp).
>
> In dfs_parse_target_referral(), passing @ref->node_name directly to
> cifs_build_devname() and smb3_parse_devname() copies UTF-8 bytes into
> ctx->UNC and ctx->prepath (and mixes encodings when @prepath from
> @full_path is also non-empty). On mounts using a non-UTF-8 iocharset
> such as iso8859-1, subsequent path checks re-encode these strings to
> UTF-16LE using local_nls, corrupting non-ASCII characters on the wire
> and causing initial mount to fail with -ENOENT.
>
> Convert @ref->node_name from cache_cp to ctx->local_nls with
> dfs_cache_local_path() before building the device name so ctx->UNC and
> ctx->prepath stay in the mount charset.
> ...
Applied.