cifs: Add support for creating WSL-style symlinks
authorPali Rohár <pali@kernel.org>
Sat, 28 Sep 2024 11:24:26 +0000 (13:24 +0200)
committerSteve French <stfrench@microsoft.com>
Fri, 31 Jan 2025 18:51:44 +0000 (12:51 -0600)
commit4e2043be5c149cb07d806c438a8ec8657741bd31
treeb5e3e8f050657fd3e771d55b97d06a204dee5cea
parenteea5119fa5979c350af5783a8148eacdd4219715
cifs: Add support for creating WSL-style symlinks

This change implements support for creating new symlink in WSL-style by
Linux cifs client when -o reparse=wsl mount option is specified. WSL-style
symlink uses reparse point with tag IO_REPARSE_TAG_LX_SYMLINK and symlink
target location is stored in reparse buffer in UTF-8 encoding prefixed by
32-bit flags. Flags bits are unknown, but it was observed that WSL always
sets flags to value 0x02000000. Do same in Linux cifs client.

New symlinks would be created in WSL-style only in case the mount option
-o reparse=wsl is specified, which is not by default. So default CIFS
mounts are not affected by this change.

Signed-off-by: Pali Rohár <pali@kernel.org>
Signed-off-by: Steve French <stfrench@microsoft.com>
fs/smb/client/reparse.c