mirror of
https://github.com/torvalds/linux.git
synced 2024-11-27 06:31:52 +00:00
net/sunrpc: Fix return value for sysctl sunrpc.transports
Fix returning value for sysctl sunrpc.transports. Return error code from sysctl proc_handler function proc_do_xprt instead of number of the written bytes. Otherwise sysctl returns random garbage for this key. Since v1: - Handle negative returned value from memory_read_from_buffer as an error Signed-off-by: Artur Molchanov <arturmolchanov@gmail.com> Cc: stable@vger.kernel.org Signed-off-by: J. Bruce Fields <bfields@redhat.com>
This commit is contained in:
parent
9f0b5792f0
commit
c09f56b8f6
@ -70,7 +70,13 @@ static int proc_do_xprt(struct ctl_table *table, int write,
|
||||
return 0;
|
||||
}
|
||||
len = svc_print_xprts(tmpbuf, sizeof(tmpbuf));
|
||||
return memory_read_from_buffer(buffer, *lenp, ppos, tmpbuf, len);
|
||||
*lenp = memory_read_from_buffer(buffer, *lenp, ppos, tmpbuf, len);
|
||||
|
||||
if (*lenp < 0) {
|
||||
*lenp = 0;
|
||||
return -EINVAL;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
|
Loading…
Reference in New Issue
Block a user