diff options
author | Paulo Alcantara <pc@manguebit.com> | 2024-04-01 22:44:09 -0300 |
---|---|---|
committer | Steve French <stfrench@microsoft.com> | 2024-04-02 10:12:22 -0500 |
commit | 93cee45ccfebc62a3bb4cd622b89e00c8c7d8493 (patch) | |
tree | 039a43ddb20695fb0d606e0cc7761fee37d2d435 /fs/smb/client/fs_context.h | |
parent | 4a5ba0e0bfe552ac7451f57e304f6343c3d87f89 (diff) | |
download | linux-93cee45ccfebc62a3bb4cd622b89e00c8c7d8493.tar.gz linux-93cee45ccfebc62a3bb4cd622b89e00c8c7d8493.tar.bz2 linux-93cee45ccfebc62a3bb4cd622b89e00c8c7d8493.zip |
smb: client: serialise cifs_construct_tcon() with cifs_mount_mutex
Serialise cifs_construct_tcon() with cifs_mount_mutex to handle
parallel mounts that may end up reusing the session and tcon created
by it.
Cc: stable@vger.kernel.org # 6.4+
Signed-off-by: Paulo Alcantara (Red Hat) <pc@manguebit.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
Diffstat (limited to 'fs/smb/client/fs_context.h')
-rw-r--r-- | fs/smb/client/fs_context.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/fs/smb/client/fs_context.h b/fs/smb/client/fs_context.h index 7863f2248c4d..8a35645e0b65 100644 --- a/fs/smb/client/fs_context.h +++ b/fs/smb/client/fs_context.h @@ -304,4 +304,16 @@ extern void smb3_update_mnt_flags(struct cifs_sb_info *cifs_sb); #define MAX_CACHED_FIDS 16 extern char *cifs_sanitize_prepath(char *prepath, gfp_t gfp); +extern struct mutex cifs_mount_mutex; + +static inline void cifs_mount_lock(void) +{ + mutex_lock(&cifs_mount_mutex); +} + +static inline void cifs_mount_unlock(void) +{ + mutex_unlock(&cifs_mount_mutex); +} + #endif |