]> www.infradead.org Git - users/dwmw2/linux.git/commit
cifs: Add mount option -o symlink= for choosing symlink create type
authorPali Rohár <pali@kernel.org>
Fri, 11 Oct 2024 09:20:56 +0000 (11:20 +0200)
committerSteve French <stfrench@microsoft.com>
Wed, 29 Jan 2025 23:35:32 +0000 (17:35 -0600)
commit660618dde2b4c372132a6be62f11ab68a0a1571a
tree610a746e53bdd628603bac5c51b741dc539fe1cb
parent12b466eb52d926802b6898d2cb7e67386467f54a
cifs: Add mount option -o symlink= for choosing symlink create type

Currently Linux CIFS client creates a new symlink of the first flavor which
is allowed by mount options, parsed in this order: -o (no)mfsymlinks,
-o (no)sfu, -o (no)unix (+ its aliases) and -o reparse=[type].

Introduce a new mount option -o symlink= for explicitly choosing a symlink
flavor. Possible options are:

  -o symlink=default    - The default behavior, like before this change.
  -o symlink=none       - Disallow creating a new symlinks
  -o symlink=native     - Create as native SMB symlink reparse point
  -o symlink=unix       - Create via SMB1 unix extension command
  -o symlink=mfsymlinks - Create as regular file of mfsymlinks format
  -o symlink=sfu        - Create as regular system file of SFU format
  -o symlink=nfs        - Create as NFS reparse point
  -o symlink=wsl        - Create as WSL reparse point

So for example specifying -o sfu,mfsymlinks,symlink=native will allow to
parse symlinks also of SFU and mfsymlinks types (which are disabled by
default unless mount option is explicitly specified), but new symlinks will
be created under native SMB type (which parsing is always enabled).

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