@@ -597,7 +597,7 @@ static ssize_t proc_sys_call_handler(struct kiocb *iocb, struct iov_iter *iter,
goto out_free_buf;
/* careful: calling conventions are nasty here */
- error = table->proc_handler(table, write, kbuf, &count, &iocb->ki_pos);
+ error = sysctl_run_handler(table, write, kbuf, &count, &iocb->ki_pos);
if (error)
goto out_free_buf;
@@ -298,4 +298,10 @@ static inline bool sysctl_is_alias(char *param)
int sysctl_max_threads(struct ctl_table *table, int write, void *buffer,
size_t *lenp, loff_t *ppos);
+static inline int sysctl_run_handler(struct ctl_table *ctl, int write,
+ void *buffer, size_t *lenp, loff_t *ppos)
+{
+ return ctl->proc_handler(ctl, write, buffer, lenp, ppos);
+}
+
#endif /* _LINUX_SYSCTL_H */
A future patch will introduce a second handler function. To make the code future-proof add the sysctl_run_handler function that automatically can call the correct handler function. Signed-off-by: Thomas Weißschuh <linux@weissschuh.net> --- fs/proc/proc_sysctl.c | 2 +- include/linux/sysctl.h | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-)