Skip to content

Commit 72f4d48

Browse files
pcacjrsmfrench
authored andcommitted
smb: client: fix regression with mount options parsing
After commit 1ef15fb ("cifs: client: enforce consistent handling of multichannel and max_channels"), invalid mount options started to be ignored, allowing cifs.ko to proceed with the mount instead of baling out. The problem was related to smb3_handle_conflicting_options() being called even when an invalid parameter had been parsed, overwriting the return value of vfs_parse_fs_string() in smb3_fs_context_parse_monolithic(). Fix this by calling smb3_handle_conflicting_options() only when a valid mount option has been passed. Reproducer: $ mount.cifs //srv/share /mnt -o ${opts} $ mount -o remount,foo,${opts} /mnt # must fail Fixes: 1ef15fb ("cifs: client: enforce consistent handling of multichannel and max_channels") Reported-by: Xiaoli Feng <xifeng@redhat.com> Signed-off-by: Paulo Alcantara (Red Hat) <pc@manguebit.org> Cc: David Howells <dhowells@redhat.com> Cc: linux-cifs@vger.kernel.org Signed-off-by: Steve French <stfrench@microsoft.com>
1 parent d53f4d9 commit 72f4d48

1 file changed

Lines changed: 1 addition & 3 deletions

File tree

fs/smb/client/fs_context.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -825,9 +825,7 @@ static int smb3_fs_context_parse_monolithic(struct fs_context *fc,
825825
if (ret < 0)
826826
break;
827827
}
828-
ret = smb3_handle_conflicting_options(fc);
829-
830-
return ret;
828+
return ret ?: smb3_handle_conflicting_options(fc);
831829
}
832830

833831
/*

0 commit comments

Comments
 (0)