Skip to content

Commit 15e2721

Browse files
cschoenebeckmartinetd
authored andcommitted
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: Vivek Goyal <[email protected]> Signed-off-by: Christian Schoenebeck <[email protected]> Signed-off-by: Dominique Martinet <[email protected]>
1 parent deadd87 commit 15e2721

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

net/9p/client.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1038,8 +1038,13 @@ struct p9_client *p9_client_create(const char *dev_name, char *options)
10381038
if (err)
10391039
goto put_trans;
10401040

1041-
if (clnt->msize > clnt->trans_mod->maxsize)
1041+
if (clnt->msize > clnt->trans_mod->maxsize) {
10421042
clnt->msize = clnt->trans_mod->maxsize;
1043+
pr_info("Limiting 'msize' to %d as this is the maximum "
1044+
"supported by transport %s\n",
1045+
clnt->msize, clnt->trans_mod->name
1046+
);
1047+
}
10431048

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

0 commit comments

Comments
 (0)