smb: client: sync the root session and superblock context passwords before automounting
authorMeetakshi Setiya <msetiya@microsoft.com>
Wed, 8 Jan 2025 10:10:34 +0000 (05:10 -0500)
committerSteve French <stfrench@microsoft.com>
Fri, 10 Jan 2025 23:55:35 +0000 (17:55 -0600)
commit20b1aa912316ffb7fbb5f407f17c330f2a22ddff
treec98b59512e830cb71f8f75bd7913748260a5bcf8
parent9d89551994a430b50c4fffcb1e617a057fa76e20
smb: client: sync the root session and superblock context passwords before automounting

In some cases, when password2 becomes the working password, the
client swaps the two password fields in the root session struct, but
not in the smb3_fs_context struct in cifs_sb. DFS automounts inherit
fs context from their parent mounts. Therefore, they might end up
getting the passwords in the stale order.
The automount should succeed, because the mount function will end up
retrying with the actual password anyway. But to reduce these
unnecessary session setup retries for automounts, we can sync the
parent context's passwords with the root session's passwords before
duplicating it to the child's fs context.

Cc: stable@vger.kernel.org
Signed-off-by: Meetakshi Setiya <msetiya@microsoft.com>
Reviewed-by: Shyam Prasad N <sprasad@microsoft.com>
Acked-by: Paulo Alcantara (Red Hat) <pc@manguebit.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
fs/smb/client/namespace.c
This page took 0.056809 seconds and 4 git commands to generate.