mirror of
https://github.com/raspberrypi/linux.git
synced 2025-12-06 01:49:46 +00:00
Fix match_prepath()
commitcd8c42968eupstream. Incorrect return value for shares not using the prefix path means that we will never match superblocks for these shares. Fixes: commitc1d8b24d18("Compare prepaths when comparing superblocks") Signed-off-by: Sachin Prabhu <sprabhu@redhat.com> Reviewed-by: Pavel Shilovsky <pshilov@microsoft.com> Signed-off-by: Steve French <smfrench@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
d322fd67ca
commit
ecf9bb0fd7
@@ -2912,16 +2912,14 @@ match_prepath(struct super_block *sb, struct cifs_mnt_data *mnt_data)
|
||||
{
|
||||
struct cifs_sb_info *old = CIFS_SB(sb);
|
||||
struct cifs_sb_info *new = mnt_data->cifs_sb;
|
||||
bool old_set = old->mnt_cifs_flags & CIFS_MOUNT_USE_PREFIX_PATH;
|
||||
bool new_set = new->mnt_cifs_flags & CIFS_MOUNT_USE_PREFIX_PATH;
|
||||
|
||||
if (old->mnt_cifs_flags & CIFS_MOUNT_USE_PREFIX_PATH) {
|
||||
if (!(new->mnt_cifs_flags & CIFS_MOUNT_USE_PREFIX_PATH))
|
||||
return 0;
|
||||
/* The prepath should be null terminated strings */
|
||||
if (strcmp(new->prepath, old->prepath))
|
||||
return 0;
|
||||
|
||||
if (old_set && new_set && !strcmp(new->prepath, old->prepath))
|
||||
return 1;
|
||||
}
|
||||
else if (!old_set && !new_set)
|
||||
return 1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user