summaryrefslogtreecommitdiffstats
path: root/fs/cifs/connect.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2017-05-02 11:16:29 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2017-05-02 11:16:29 -0700
commit6fd4e7f7744bd7859ca3cae19c4613252ebb6bff (patch)
tree2d8bd695f467d991f4de5fedf3d210e5f39c093f /fs/cifs/connect.c
parent5958cc49ed2961a059d92ae55afeeaba64a783a0 (diff)
parenta6f74e80f271b19ea709cbda55e8eb67e9ffccf2 (diff)
downloadlinux-6fd4e7f7744bd7859ca3cae19c4613252ebb6bff.tar.gz
linux-6fd4e7f7744bd7859ca3cae19c4613252ebb6bff.tar.bz2
linux-6fd4e7f7744bd7859ca3cae19c4613252ebb6bff.zip
Merge branch 'for-next' of git://git.samba.org/sfrench/cifs-2.6
Pull CIFS fixes from Steve French: "Three cifs/smb3 fixes - including two for stable" * 'for-next' of git://git.samba.org/sfrench/cifs-2.6: cifs: don't check for failure from mempool_alloc() Do not return number of bytes written for ioctl CIFS_IOC_COPYCHUNK_FILE Fix match_prepath()
Diffstat (limited to 'fs/cifs/connect.c')
-rw-r--r--fs/cifs/connect.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c
index b3c9d8c310f2..0f2781677ccc 100644
--- a/fs/cifs/connect.c
+++ b/fs/cifs/connect.c
@@ -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;
}