mbox series

[v2,0/9] reparse points work

Message ID 20231126025510.28147-1-pc@manguebit.com (mailing list archive)
Headers show
Series reparse points work | expand

Message

Paulo Alcantara Nov. 26, 2023, 2:55 a.m. UTC
Hi Steve,

This series contains reparse point fixes and improvements for SMB2+:

- Add support for creating character/block devices, sockets and fifos
  via NFS reparse points by default.

- Add support for creating SMB symlinks via IO_REPARSE_TAG_SYMLINK
  reparse points.

- smb2_compound_op()

  * allow up to MAX_COMPOUND(5) commands in a single compound request
  * introduce SMB2_OP_{GET,SET}_REPARSE commands

- Optimisations for dentry revalidation and read/write of reparse
  points by reducing number of roundtrips.

- Fix renaming and hardlinking of reparse points

For people who pass 'mfsymlinks' and 'sfu' mount options, the
implementation is expected to avoid creating reparse points at all.

Volker Lendecke had suggested trying to create both SMB symlink and
mfsymlink in a single compound request but this series doesn't have
it.  It could be implemented later.

Signed-off-by: Paulo Alcantara (SUSE) <pc@manguebit.com>
---
Changes in v2:
- Fix missing mode bits for SMB symlinks (reported by Steve)
- Fix uninitialised var warnings (reported by kernel test robot)
- Add dentry reval optimisation for SMB3 POSIX query info as well

---
Paulo Alcantara (9):
  smb: client: extend smb2_compound_op() to accept more commands
  smb: client: allow creating special files via reparse points
  smb: client: allow creating symlinks via reparse points
  smb: client: optimise reparse point querying
  smb: client: fix renaming of reparse points
  smb: client: fix hardlinking of reparse points
  smb: client: cleanup smb2_query_reparse_point()
  smb: client: optimise dentry revalidation for reparse points
  smb: client: fix missing mode bits for SMB symlinks

 fs/smb/client/cifsglob.h  |   47 +-
 fs/smb/client/cifsproto.h |   30 +-
 fs/smb/client/cifssmb.c   |   17 +-
 fs/smb/client/dir.c       |    7 +-
 fs/smb/client/file.c      |   10 +-
 fs/smb/client/inode.c     |   98 ++--
 fs/smb/client/link.c      |   29 +-
 fs/smb/client/smb2glob.h  |   26 +-
 fs/smb/client/smb2inode.c | 1054 ++++++++++++++++++++++---------------
 fs/smb/client/smb2ops.c   |  297 ++++++-----
 fs/smb/client/smb2proto.h |   29 +-
 fs/smb/client/trace.h     |    7 +-
 12 files changed, 997 insertions(+), 654 deletions(-)

Comments

Steve French Nov. 27, 2023, 4:28 a.m. UTC | #1
tentatively merged to cifs-2.6.git for-next pending more testing and review

rearranged order slightly to move patch 9 up (and added Cc: stable to that one)

On Sat, Nov 25, 2023 at 8:55 PM Paulo Alcantara <pc@manguebit.com> wrote:
>
> Hi Steve,
>
> This series contains reparse point fixes and improvements for SMB2+:
>
> - Add support for creating character/block devices, sockets and fifos
>   via NFS reparse points by default.
>
> - Add support for creating SMB symlinks via IO_REPARSE_TAG_SYMLINK
>   reparse points.
>
> - smb2_compound_op()
>
>   * allow up to MAX_COMPOUND(5) commands in a single compound request
>   * introduce SMB2_OP_{GET,SET}_REPARSE commands
>
> - Optimisations for dentry revalidation and read/write of reparse
>   points by reducing number of roundtrips.
>
> - Fix renaming and hardlinking of reparse points
>
> For people who pass 'mfsymlinks' and 'sfu' mount options, the
> implementation is expected to avoid creating reparse points at all.
>
> Volker Lendecke had suggested trying to create both SMB symlink and
> mfsymlink in a single compound request but this series doesn't have
> it.  It could be implemented later.
>
> Signed-off-by: Paulo Alcantara (SUSE) <pc@manguebit.com>
> ---
> Changes in v2:
> - Fix missing mode bits for SMB symlinks (reported by Steve)
> - Fix uninitialised var warnings (reported by kernel test robot)
> - Add dentry reval optimisation for SMB3 POSIX query info as well
>
> ---
> Paulo Alcantara (9):
>   smb: client: extend smb2_compound_op() to accept more commands
>   smb: client: allow creating special files via reparse points
>   smb: client: allow creating symlinks via reparse points
>   smb: client: optimise reparse point querying
>   smb: client: fix renaming of reparse points
>   smb: client: fix hardlinking of reparse points
>   smb: client: cleanup smb2_query_reparse_point()
>   smb: client: optimise dentry revalidation for reparse points
>   smb: client: fix missing mode bits for SMB symlinks
>
>  fs/smb/client/cifsglob.h  |   47 +-
>  fs/smb/client/cifsproto.h |   30 +-
>  fs/smb/client/cifssmb.c   |   17 +-
>  fs/smb/client/dir.c       |    7 +-
>  fs/smb/client/file.c      |   10 +-
>  fs/smb/client/inode.c     |   98 ++--
>  fs/smb/client/link.c      |   29 +-
>  fs/smb/client/smb2glob.h  |   26 +-
>  fs/smb/client/smb2inode.c | 1054 ++++++++++++++++++++++---------------
>  fs/smb/client/smb2ops.c   |  297 ++++++-----
>  fs/smb/client/smb2proto.h |   29 +-
>  fs/smb/client/trace.h     |    7 +-
>  12 files changed, 997 insertions(+), 654 deletions(-)
>
> --
> 2.43.0
>
Paulo Alcantara Nov. 27, 2023, 10:14 a.m. UTC | #2
Steve French <smfrench@gmail.com> writes:

> tentatively merged to cifs-2.6.git for-next pending more testing and
> review

Please drop patch 8/9 as it is wrong.  We can't really do that as the
file could have been changed on server side to a regular file and
therefore the client would keep trying to open it as a reparse point.
That can be easily reproduced.

Yeah, that is the price we get when we don't have such information
directly from query dir responses.  Looking forward to having it with
the SMB3 POSIX spec :-)