Hi Vlastimil, Thank you for the patch! Perhaps something to improve: [auto build test WARNING on kees/for-next/pstore] [also build test WARNING on linus/master linux/master v5.6 next-20200330] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system. BTW, we also suggest to use '--base' option to specify the base tree in git format-patch, please see https://stackoverflow.com/a/37406982] url: https://github.com/0day-ci/linux/commits/Vlastimil-Babka/support-setting-sysctl-parameters-from-kernel-command-line/20200331-023453 base: https://git.kernel.org/pub/scm/linux/kernel/git/kees/linux.git for-next/pstore config: um-i386_defconfig (attached as .config) compiler: gcc-7 (Debian 7.4.0-6) 7.4.0 reproduce: # save the attached .config to linux build tree make ARCH=um SUBARCH=i386 If you fix the issue, kindly add following tag Reported-by: kbuild test robot All warnings (new ones prefixed by >>): In file included from include/linux/printk.h:7:0, from include/linux/kernel.h:15, from include/linux/list.h:9, from include/linux/sysctl.h:25, from fs/proc/proc_sysctl.c:6: fs/proc/proc_sysctl.c: In function 'process_sysctl_arg': include/linux/kern_levels.h:5:18: warning: format '%ld' expects argument of type 'long int', but argument 2 has type 'ssize_t {aka int}' [-Wformat=] #define KERN_SOH "\001" /* ASCII Start Of Header */ ^ include/linux/kern_levels.h:11:18: note: in expansion of macro 'KERN_SOH' #define KERN_ERR KERN_SOH "3" /* error conditions */ ^~~~~~~~ include/linux/printk.h:304:9: note: in expansion of macro 'KERN_ERR' printk(KERN_ERR pr_fmt(fmt), ##__VA_ARGS__) ^~~~~~~~ >> fs/proc/proc_sysctl.c:1798:3: note: in expansion of macro 'pr_err' pr_err("Wrote only %ld bytes of %d writing to proc file %s to set sysctl parameter '%s=%s'", ^~~~~~ fs/proc/proc_sysctl.c:1798:24: note: format string is defined here pr_err("Wrote only %ld bytes of %d writing to proc file %s to set sysctl parameter '%s=%s'", ~~^ %d vim +/pr_err +1798 fs/proc/proc_sysctl.c 1729 1730 /* Set sysctl value passed on kernel command line. */ 1731 static int process_sysctl_arg(char *param, char *val, 1732 const char *unused, void *arg) 1733 { 1734 char *path; 1735 struct vfsmount *proc_mnt = *((struct vfsmount **)arg); 1736 struct file_system_type *proc_fs_type; 1737 struct file *file; 1738 int len; 1739 int err; 1740 loff_t pos = 0; 1741 ssize_t wret; 1742 1743 if (strncmp(param, "sysctl", sizeof("sysctl") - 1)) 1744 return 0; 1745 1746 param += sizeof("sysctl") - 1; 1747 1748 if (param[0] != '/' && param[0] != '.') 1749 return 0; 1750 1751 param++; 1752 1753 if (!proc_mnt) { 1754 proc_fs_type = get_fs_type("proc"); 1755 if (!proc_fs_type) { 1756 pr_err("Failed to find procfs to set sysctl from command line"); 1757 return 0; 1758 } 1759 proc_mnt = kern_mount(proc_fs_type); 1760 put_filesystem(proc_fs_type); 1761 if (IS_ERR(proc_mnt)) { 1762 pr_err("Failed to mount procfs to set sysctl from command line"); 1763 return 0; 1764 } 1765 *((struct vfsmount **)arg) = proc_mnt; 1766 } 1767 1768 path = kasprintf(GFP_KERNEL, "sys/%s", param); 1769 if (!path) 1770 panic("%s: Failed to allocate path for %s\n", __func__, param); 1771 strreplace(path, '.', '/'); 1772 1773 file = file_open_root(proc_mnt->mnt_root, proc_mnt, path, O_WRONLY, 0); 1774 if (IS_ERR(file)) { 1775 err = PTR_ERR(file); 1776 if (err == -ENOENT) 1777 pr_err("Failed to set sysctl parameter '%s=%s': parameter not found", 1778 param, val); 1779 else if (err == -EACCES) 1780 pr_err("Failed to set sysctl parameter '%s=%s': permission denied (read-only?)", 1781 param, val); 1782 else 1783 pr_err("Error %pe opening proc file to set sysctl parameter '%s=%s'", 1784 file, param, val); 1785 goto out; 1786 } 1787 len = strlen(val); 1788 wret = kernel_write(file, val, len, &pos); 1789 if (wret < 0) { 1790 err = wret; 1791 if (err == -EINVAL) 1792 pr_err("Failed to set sysctl parameter '%s=%s': invalid value", 1793 param, val); 1794 else 1795 pr_err("Error %pe writing to proc file to set sysctl parameter '%s=%s'", 1796 ERR_PTR(err), param, val); 1797 } else if (wret != len) { > 1798 pr_err("Wrote only %ld bytes of %d writing to proc file %s to set sysctl parameter '%s=%s'", 1799 wret, len, path, param, val); 1800 } 1801 1802 err = filp_close(file, NULL); 1803 if (err) 1804 pr_err("Error %pe closing proc file to set sysctl parameter '%s=%s'", 1805 ERR_PTR(err), param, val); 1806 out: 1807 kfree(path); 1808 return 0; 1809 } 1810 --- 0-DAY CI Kernel Test Service, Intel Corporation https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org