Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

net/sunrpc: return 0 on attempt to write to "transports"

You can't write to this file because the permissions are 0444. But
it sort of looked like you could do a write and it would result in
a read. Then it looked like proc_sys_call_handler() just ignored
it. Which is confusing. It's more clear if the "write" just
returns zero.

Also, the "lenp" pointer is never NULL so that check can be removed.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>

authored by

Dan Carpenter and committed by
J. Bruce Fields
d435c05a 49a36132

+1 -1
+1 -1
net/sunrpc/sysctl.c
··· 65 65 char tmpbuf[256]; 66 66 size_t len; 67 67 68 - if ((*ppos && !write) || !*lenp) { 68 + if (write || *ppos) { 69 69 *lenp = 0; 70 70 return 0; 71 71 }