Commit cd8c4296 authored by Sachin Prabhu's avatar Sachin Prabhu Committed by Steve French

Fix match_prepath()

Incorrect return value for shares not using the prefix path means that
we will never match superblocks for these shares.

Fixes: commit c1d8b24d ("Compare prepaths when comparing superblocks")
Cc: stable@vger.kernel.org
Signed-off-by: default avatarSachin Prabhu <sprabhu@redhat.com>
Reviewed-by: default avatarPavel Shilovsky <pshilov@microsoft.com>
Signed-off-by: default avatarSteve French <smfrench@gmail.com>
parent 19ac4474
...@@ -2912,16 +2912,14 @@ match_prepath(struct super_block *sb, struct cifs_mnt_data *mnt_data) ...@@ -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 *old = CIFS_SB(sb);
struct cifs_sb_info *new = mnt_data->cifs_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 (old_set && new_set && !strcmp(new->prepath, old->prepath))
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;
return 1; return 1;
} else if (!old_set && !new_set)
return 1;
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment