public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/7] cifs: Improve support for native SMB symlinks
@ 2024-09-29 18:50 Pali Rohár
  2024-09-29 18:50 ` [PATCH 1/7] cifs: Rename smb2_get_reparse_inode to smb2_create_reparse_inode Pali Rohár
                   ` (8 more replies)
  0 siblings, 9 replies; 38+ messages in thread
From: Pali Rohár @ 2024-09-29 18:50 UTC (permalink / raw)
  To: Steve French, Paulo Alcantara, Ronnie Sahlberg; +Cc: linux-cifs, linux-kernel

This patch series improves interoperability of native SMB symlinks
(stored in IO_REPARSE_TAG_SYMLINK reparse point) between Linux SMB
client and Windows SMB server storage (NTFS).

Fixed test cases by this patch series are:

Fixes parsing of symlinks relative to the top of the export which can be
created on Windows by:

  mklink symlink \relative\path\from\export


Fixes parsing of symlinks in absolute form which can be created on
Windows by:

  mklink symlink C:\absolute\path


Fixes creating of symlinks pointing to directory. So Linux commands:

  mkdir dir
  ln -s dir symlink1
  ln -s another_dir/ symlink2

creates a symlink which would be now understood also by Windows as
symlinks to directories.


Fixes creating of symlinks pointing to current or parent directory.
So following commands create valid symlink understood by Windows:

  ln -s . symlink_cur
  ln -s .. symlink_parent


Fixes creating of absolute symlinks. Absolute symlinks on Windows are
quite complicated due to nature of DOS/Win32 path form used by Windows
applications and NT path form in which are symlink paths stored. Also
complication is that NT object paths have different hierarchy than POSIX
paths generally. Required information about NT object hierarchy used in
native absolute symlinks are in comments in the last patch from this
series.

To resolve mentioned problems I chosse way which is used by WSL, its
-t drvfs has mount option -o symlinkroot= which specify Linux path there
should point absolute windows drive letter symlinks. This could make
-t cifs mounts in WSL2 more compatible with symlinks coming from local
NTFS disks mounted by -t drvfs.

I'm not sure how good are these changes, but I think that they improve
compatibility of symlinks between Linux and Windows systems. Maybe there
is some better solution how to handle some of those issues?


Pali Rohár (7):
  cifs: Rename smb2_get_reparse_inode to smb2_create_reparse_inode
  cifs: Improve creating native symlinks pointing to directory
  cifs: Fix creating native symlinks pointing to current or parent
    directory
  cifs: Fix parsing native symlinks relative to the export
  cifs: Fix parsing native symlinks directory/file type
  cifs: Validate content of native symlink
  cifs: Fix creating and resolving absolute NT-style symlinks

 fs/smb/client/cifs_unicode.c |  17 +-
 fs/smb/client/cifsglob.h     |   1 +
 fs/smb/client/cifsproto.h    |   1 +
 fs/smb/client/fs_context.c   |  22 ++
 fs/smb/client/fs_context.h   |   2 +
 fs/smb/client/inode.c        |   1 +
 fs/smb/client/reparse.c      | 513 ++++++++++++++++++++++++++++++++---
 fs/smb/client/reparse.h      |   4 +-
 fs/smb/client/smb1ops.c      |   3 +-
 fs/smb/client/smb2file.c     |  67 ++++-
 fs/smb/client/smb2inode.c    |  15 +-
 fs/smb/client/smb2proto.h    |  13 +-
 12 files changed, 602 insertions(+), 57 deletions(-)

-- 
2.20.1


^ permalink raw reply	[flat|nested] 38+ messages in thread

end of thread, other threads:[~2024-12-09 18:02 UTC | newest]

Thread overview: 38+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-09-29 18:50 [PATCH 0/7] cifs: Improve support for native SMB symlinks Pali Rohár
2024-09-29 18:50 ` [PATCH 1/7] cifs: Rename smb2_get_reparse_inode to smb2_create_reparse_inode Pali Rohár
2024-09-29 21:16   ` Steve French
2024-09-29 22:05     ` Pali Rohár
2024-09-29 18:50 ` [PATCH 2/7] cifs: Improve creating native symlinks pointing to directory Pali Rohár
2024-09-29 21:54   ` Steve French
2024-09-29 22:11     ` Pali Rohár
2024-09-30 15:09   ` Paulo Alcantara
2024-09-30 17:17     ` Pali Rohár
2024-10-05 14:08       ` Pali Rohár
2024-09-29 18:50 ` [PATCH 3/7] cifs: Fix creating native symlinks pointing to current or parent directory Pali Rohár
2024-09-29 18:50 ` [PATCH 4/7] cifs: Fix parsing native symlinks relative to the export Pali Rohár
2024-09-29 18:50 ` [PATCH 5/7] cifs: Fix parsing native symlinks directory/file type Pali Rohár
2024-09-29 21:47   ` Steve French
2024-09-29 21:58     ` Pali Rohár
2024-09-29 18:50 ` [PATCH 6/7] cifs: Validate content of native symlink Pali Rohár
2024-09-29 21:48   ` Steve French
2024-09-29 22:19     ` Pali Rohár
2024-09-30 20:00       ` Pali Rohár
2024-09-29 18:50 ` [PATCH 7/7] cifs: Fix creating and resolving absolute NT-style symlinks Pali Rohár
2024-09-29 22:03 ` [PATCH 0/7] cifs: Improve support for native SMB symlinks Steve French
2024-10-05 14:07   ` Pali Rohár
2024-10-05 14:02 ` [PATCH v2 0/6] " Pali Rohár
2024-10-05 14:02   ` [PATCH v2 1/6] cifs: Improve creating native symlinks pointing to directory Pali Rohár
2024-10-05 14:02   ` [PATCH v2 2/6] cifs: Fix creating native symlinks pointing to current or parent directory Pali Rohár
2024-10-05 14:02   ` [PATCH v2 3/6] cifs: Fix parsing native symlinks relative to the export Pali Rohár
2024-10-05 14:02   ` [PATCH v2 4/6] cifs: Fix parsing native symlinks directory/file type Pali Rohár
2024-10-13 17:56     ` Steve French
2024-10-14  9:52       ` Pali Rohár
2024-10-15 14:30     ` [PATCH v3] " Pali Rohár
2024-12-09 18:02       ` Pali Rohár
2024-10-05 14:02   ` [PATCH v2 5/6] cifs: Validate content of native symlink Pali Rohár
2024-10-13  4:21     ` Steve French
2024-10-14  9:39       ` Pali Rohár
2024-10-05 14:03   ` [PATCH v2 6/6] cifs: Fix creating and resolving absolute NT-style symlinks Pali Rohár
2024-10-07  3:59     ` Steve French
2024-10-07 18:09       ` Pali Rohár
2024-12-09 17:58     ` Pali Rohár

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox