diff options
author | Shyam Prasad N <sprasad@microsoft.com> | 2021-02-11 14:26:54 +0300 |
---|---|---|
committer | Steve French <stfrench@microsoft.com> | 2021-02-11 20:08:32 +0300 |
commit | a738c93fb1c17e386a09304b517b1c6b2a6a5a8b (patch) | |
tree | b852c26ae5873c4888bc11739ac4b80833227a93 /fs/cifs/connect.c | |
parent | af1a3d2ba9543e99d78914d8fb88b61d0531d9a1 (diff) | |
download | linux-a738c93fb1c17e386a09304b517b1c6b2a6a5a8b.tar.xz |
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 <sprasad@microsoft.com>
Reviewed-by: Aurelien Aptel <aaptel@suse.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
Diffstat (limited to 'fs/cifs/connect.c')
-rw-r--r-- | fs/cifs/connect.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c index 76e4d8d8b3a6..4bb9decbbf27 100644 --- a/fs/cifs/connect.c +++ b/fs/cifs/connect.c @@ -2756,6 +2756,7 @@ int cifs_setup_cifs_sb(struct cifs_sb_info *cifs_sb) cifs_sb->prepath = kstrdup(ctx->prepath, GFP_KERNEL); if (cifs_sb->prepath == NULL) return -ENOMEM; + cifs_sb->mnt_cifs_flags |= CIFS_MOUNT_USE_PREFIX_PATH; } return 0; |