Commit 0fc9322a authored by Maciek Borzecki's avatar Maciek Borzecki Committed by Steve French
Browse files

cifs: escape spaces in share names



Commit 653a5efb ("cifs: update super_operations to show_devname")
introduced the display of devname for cifs mounts. However, when mounting
a share which has a whitespace in the name, that exact share name is also
displayed in mountinfo. Make sure that all whitespace is escaped.

Signed-off-by: default avatarMaciek Borzecki <maciek.borzecki@gmail.com>
CC: <stable@vger.kernel.org> # 5.11+
Reviewed-by: default avatarShyam Prasad N <sprasad@microsoft.com>
Signed-off-by: default avatarSteve French <stfrench@microsoft.com>
parent d135be0a
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -476,7 +476,8 @@ static int cifs_show_devname(struct seq_file *m, struct dentry *root)
		seq_puts(m, "none");
	else {
		convert_delimiter(devname, '/');
		seq_puts(m, devname);
		/* escape all spaces in share names */
		seq_escape(m, devname, " \t");
		kfree(devname);
	}
	return 0;