* [PATCH] cifs: Set CIFS_MOUNT_USE_PREFIX_PATH flag on setting cifs_sb->prepath.
@ 2021-02-11 11:26 Shyam Prasad N
2021-02-11 12:13 ` Aurélien Aptel
0 siblings, 1 reply; 2+ messages in thread
From: Shyam Prasad N @ 2021-02-11 11:26 UTC (permalink / raw)
To: Steve French, ronnie sahlberg, Aurélien Aptel, CIFS
[-- Attachment #1: Type: text/plain, Size: 638 bytes --]
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) results in sharing
the cifs superblock.
This could likely result in issues in other code paths as well.
Based on cursory code review, I think the CIFS_MOUNT_USE_PREFIX_PATH
flag is always used in conjunction with the cifs_sb->prepath field.
Attached patch sets this flag as soon as the prepath field is set in cifs_sb.
Please let me know if any of the above assumptions are wrong, or if
more needs to be done as a part of this fix.
--
Regards,
Shyam
[-- Attachment #2: 0001-cifs-Set-CIFS_MOUNT_USE_PREFIX_PATH-flag-on-setting-.patch --]
[-- Type: application/octet-stream, Size: 937 bytes --]
From 3a1374f02d76866474958624e2c512a0fea393bc Mon Sep 17 00:00:00 2001
From: Shyam Prasad N <sprasad@microsoft.com>
Date: Thu, 11 Feb 2021 03:07:13 -0800
Subject: [PATCH] cifs: Set CIFS_MOUNT_USE_PREFIX_PATH flag on setting
cifs_sb->prepath.
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.
Signed-off-by: Shyam Prasad N <sprasad@microsoft.com>
---
fs/cifs/connect.c | 1 +
1 file changed, 1 insertion(+)
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;
--
2.25.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] cifs: Set CIFS_MOUNT_USE_PREFIX_PATH flag on setting cifs_sb->prepath.
2021-02-11 11:26 [PATCH] cifs: Set CIFS_MOUNT_USE_PREFIX_PATH flag on setting cifs_sb->prepath Shyam Prasad N
@ 2021-02-11 12:13 ` Aurélien Aptel
0 siblings, 0 replies; 2+ messages in thread
From: Aurélien Aptel @ 2021-02-11 12:13 UTC (permalink / raw)
To: Shyam Prasad N, Steve French, ronnie sahlberg, CIFS
Shyam Prasad N <nspmangalore@gmail.com> writes:
> Please let me know if any of the above assumptions are wrong, or if
> more needs to be done as a part of this fix.
I think that's correct.
Reviewed-by: Aurelien Aptel <aaptel@suse.com>
--
Aurélien Aptel / SUSE Labs Samba Team
GPG: 1839 CB5F 9F5B FB9B AA97 8C99 03C8 A49B 521B D5D3
SUSE Software Solutions Germany GmbH, Maxfeldstr. 5, 90409 Nürnberg, DE
GF: Felix Imendörffer, Mary Higgins, Sri Rasiah HRB 247165 (AG München)
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-02-11 12:18 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-02-11 11:26 [PATCH] cifs: Set CIFS_MOUNT_USE_PREFIX_PATH flag on setting cifs_sb->prepath Shyam Prasad N
2021-02-11 12:13 ` Aurélien Aptel
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox