Skip to content

Commit a738c93

Browse files
sprasad-microsoftsmfrench
authored andcommitted
cifs: Set CIFS_MOUNT_USE_PREFIX_PATH flag on setting cifs_sb->prepath.
While debugging another issue today, Steve and I noticed that if a subdir for a file share is already mounted on the client, any new mount of any other subdir (or the file share root) of the same share results in sharing the cifs superblock, which e.g. can result in incorrect device name. While setting prefix path for the root of a cifs_sb, CIFS_MOUNT_USE_PREFIX_PATH flag should also be set. Without it, prepath is not even considered in some places, and output of "mount" and various /proc/<>/*mount* related options can be missing part of the device name. Signed-off-by: Shyam Prasad N <[email protected]> Reviewed-by: Aurelien Aptel <[email protected]> Signed-off-by: Steve French <[email protected]>
1 parent af1a3d2 commit a738c93

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

fs/cifs/connect.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2756,6 +2756,7 @@ int cifs_setup_cifs_sb(struct cifs_sb_info *cifs_sb)
27562756
cifs_sb->prepath = kstrdup(ctx->prepath, GFP_KERNEL);
27572757
if (cifs_sb->prepath == NULL)
27582758
return -ENOMEM;
2759+
cifs_sb->mnt_cifs_flags |= CIFS_MOUNT_USE_PREFIX_PATH;
27592760
}
27602761

27612762
return 0;

0 commit comments

Comments
 (0)