coda: fix timeout sysctl width on big-endian architecture
Subsystems (2)
PATCH 1/1 coda: fix timeout sysctl width on big-endian architecture
coda_timeout is an unsigned long, but the "timeout" sysctl entry uses proc_dointvec() with .maxlen = sizeof(int), so the handler accesses only four bytes of the eight-byte variable.
On little-endian this works, since the four bytes are the low half. On 64-bit big-endian they are the high half. The sysctl reads back 0 instead of the default 30, and writing N sets coda_timeout to N * 2^32 + 30 seconds, so a stuck upcall effectively never becomes interruptible.
Fix this by using proc_doulongvec_minmax() handler and adjust the maxlen to the right value.
---
Note: found this while fixing a similar issue on SMC sockets. This is janitorial work, I don't think CODA is used in big-endian at all.
--- fs/coda/sysctl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
fs/coda/sysctl.c +2 -2
@@ -18,9 +18,9 @@ static const struct ctl_table coda_table[] = { { .procname = "timeout", .data = &coda_timeout, - .maxlen = sizeof(int), + .maxlen = sizeof(unsigned long), .mode = 0644, - .proc_handler = proc_dointvec + .proc_handler = proc_doulongvec_minmax }, { .procname = "hard",
Signature · 1 line
2.56.0