Skip to content

Commit d435c05

Browse files
Dan CarpenterJ. Bruce Fields
authored andcommitted
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>
1 parent 49a3613 commit d435c05

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

net/sunrpc/sysctl.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ static int proc_do_xprt(struct ctl_table *table, int write,
6565
char tmpbuf[256];
6666
size_t len;
6767

68-
if ((*ppos && !write) || !*lenp) {
68+
if (write || *ppos) {
6969
*lenp = 0;
7070
return 0;
7171
}

0 commit comments

Comments
 (0)