On Tue, May 12, 2020 at 12:33:05AM +0000, Luis Chamberlain wrote: > On Mon, May 11, 2020 at 09:55:16AM +0800, Xiaoming Ni wrote: > > On 2020/5/11 9:11, Stephen Rothwell wrote: > > > Hi all, > > > > > > Today's linux-next merge of the vfs tree got a conflict in: > > > > > > kernel/sysctl.c > > > > > > between commit: > > > > > > b6522fa409cf ("parisc: add sysctl file interface panic_on_stackoverflow") > > > > > > from the parisc-hd tree and commit: > > > > > > f461d2dcd511 ("sysctl: avoid forward declarations") > > > > > > from the vfs tree. > > > > > > I fixed it up (see below) and can carry the fix as necessary. This > > > is now fixed as far as linux-next is concerned, but any non trivial > > > conflicts should be mentioned to your upstream maintainer when your tree > > > is submitted for merging. You may also want to consider cooperating > > > with the maintainer of the conflicting tree to minimise any particularly > > > complex conflicts. > > > > > > > > > Kernel/sysctl.c contains more than 190 interface files, and there are a > > large number of config macro controls. When modifying the sysctl interface > > directly in kernel/sysctl.c , conflicts are very easy to occur. > > > > At the same time, the register_sysctl_table() provided by the system can > > easily add the sysctl interface, and there is no conflict of kernel/sysctl.c > > . > > > > Should we add instructions in the patch guide (coding-style.rst > > submitting-patches.rst): > > Preferentially use register_sysctl_table() to add a new sysctl interface, > > centralize feature codes, and avoid directly modifying kernel/sysctl.c ? > > Yes, however I don't think folks know how to do this well. So I think we > just have to do at least start ourselves, and then reflect some of this > in the docs. The reason that this can be not easy is that we need to > ensure that at an init level we haven't busted dependencies on setting > this. We also just don't have docs on how to do this well. > > > In addition, is it necessary to transfer the architecture-related sysctl > > interface to arch/xxx/kernel/sysctl.c ? > > Well here's an initial attempt to start with fs stuff in a very > conservative way. What do folks think? > > [...] > +static unsigned long zero_ul; > +static unsigned long long_max = LONG_MAX; I think it'd be nice to keep these in one place for others to reuse, though that means making them non-static. (And now that I look at them, I thought they were supposed to be const?) -- Kees Cook