Commit 15e2721b authored by Christian Schoenebeck's avatar Christian Schoenebeck Committed by Dominique Martinet
Browse files

net/9p: show error message if user 'msize' cannot be satisfied

If user supplied a large value with the 'msize' option, then
client would silently limit that 'msize' value to the maximum
value supported by transport. That's a bit confusing for users
of not having any indication why the preferred 'msize' value
could not be satisfied.

Link: https://lkml.kernel.org/r/783ba37c1566dd715b9a67d437efa3b77e3cd1a7.1640870037.git.linux_oss@crudebyte.com


Reported-by: default avatarVivek Goyal <vgoyal@redhat.com>
Signed-off-by: default avatarChristian Schoenebeck <linux_oss@crudebyte.com>
Signed-off-by: default avatarDominique Martinet <asmadeus@codewreck.org>
parent deadd874
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -1038,8 +1038,13 @@ struct p9_client *p9_client_create(const char *dev_name, char *options)
	if (err)
		goto put_trans;

	if (clnt->msize > clnt->trans_mod->maxsize)
	if (clnt->msize > clnt->trans_mod->maxsize) {
		clnt->msize = clnt->trans_mod->maxsize;
		pr_info("Limiting 'msize' to %d as this is the maximum "
			"supported by transport %s\n",
			clnt->msize, clnt->trans_mod->name
		);
	}

	if (clnt->msize < 4096) {
		p9_debug(P9_DEBUG_ERROR,