Re: Can't seem to find a maintainer for init/* files

2019-10-18 Thread Paulo Almeida
> On 19/10/2019, at 11:32 AM, Greg KH wrote: > > Run scripts/get_maintainer.pl on any file and it will tell you where to > send changes to: > $ ./scripts/get_maintainer.pl --file init/do_mounts.c > Al Viro mailto:v...@zeniv.linux.org.uk>> > (commit_signer:7/9=78%,authored:5/9=56%,ad

Re: Can't seem to find a maintainer for init/* files

2019-10-18 Thread Valdis Klētnieks
On Sat, 19 Oct 2019 10:33:00 +1300, Paulo Almeida said: > 1 - This specific code block has been around for quite some time and many > additions using the correct printk(KERN_* were made after it was written. > Does that mean that this code block is an exception and should be left > as-is for some

Re: Try/catch for modules?

2019-10-18 Thread Valdis Klētnieks
On Fri, 18 Oct 2019 12:43:58 -0300, Martin Galvan said: > goto statements are harmful. For starters, note that the original paper was written in 1968. Yes, it's over a half century old now. Have you actually *read* the paper? https://homepages.cwi.nl/~storm/teaching/reader/Dijkstra68.pdf You p

Re: Can't seem to find a maintainer for init/* files

2019-10-18 Thread Greg KH
On Sat, Oct 19, 2019 at 10:33:00AM +1300, Paulo Almeida wrote: > Hi all, > > I was reading the KernelJanitor/Todo webpage and found the printk-related > task that had to be done. > > I eventually came across this piece of code that led me to 2 questions that > I couldn't answer myself > https://g

Re: Try/catch for modules?

2019-10-18 Thread Greg KH
On Fri, Oct 18, 2019 at 07:09:54PM -0300, Martin Galvan wrote: > Hi Valdis, thanks for the thorough response. > > El vie., 18 oct. 2019 a las 18:53, Valdis Klētnieks > () escribió: > > Well..here's the thing. Unless you have "panic_on_oops" set, hitting a null > > pointer will usually *NOT* panic

Re: Try/catch for modules?

2019-10-18 Thread Martin Galvan
Hi Valdis, thanks for the thorough response. El vie., 18 oct. 2019 a las 18:53, Valdis Klētnieks () escribió: > Well..here's the thing. Unless you have "panic_on_oops" set, hitting a null > pointer will usually *NOT* panic the whole system. In fact, that # in the > panic message is a counter

Re: Try/catch for modules?

2019-10-18 Thread Valdis Klētnieks
On Fri, 18 Oct 2019 13:11:54 -0300, Martin Galvan said: > I don't think I was clear. My intent is that if a pointer bug isn't > fixed, my module will fail gracefully and go through the catch block > instead of panicking the whole system. Well..here's the thing. Unless you have "panic_on_oops" s

Re: Try/catch for modules?

2019-10-18 Thread Ruben Safir
On 10/18/19 5:24 PM, Rik van Riel wrote: > Every time you test whether the PID is the PID of the > currently running process, it will be true. Think of > the kernel as a privileged shared library, not as a > program that userspace happens to communicate with. https://superuser.com/questions/197168

Re: Can't seem to find a maintainer for init/* files

2019-10-18 Thread Paulo Almeida
I believe I just found the answer for point number 2: THE REST M: Linus Torvalds L: linux-ker...@vger.kernel.org Q: http://patchwork.kernel.org/project/LKML/list/ T: git git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git S: Buried alive in reporters F: * F: */ On Sat, Oct 19, 2019

Can't seem to find a maintainer for init/* files

2019-10-18 Thread Paulo Almeida
Hi all, I was reading the KernelJanitor/Todo webpage and found the printk-related task that had to be done. I eventually came across this piece of code that led me to 2 questions that I couldn't answer myself https://github.com/torvalds/linux/blame/master/init/do_mounts.c#L434-L455 1 - This spec

Re: Try/catch for modules?

2019-10-18 Thread Ruben Safir
On 10/18/19 5:24 PM, Rik van Riel wrote: > Every time you test whether the PID is the PID of the > currently running process, it will be true. Think of > the kernel as a privileged shared library, not as a > program that userspace happens to communicate with. this last sentence can not be true.

Re: Try/catch for modules?

2019-10-18 Thread Rik van Riel
On Fri, 2019-10-18 at 12:43 -0300, Martin Galvan wrote: > El jue., 17 oct. 2019 a las 19:13, Valdis Klētnieks > () escribió: > > For starters, the *correct* in-kernel way to deal with this is: > > if (!ptr) { > > printk("You blew it!\n"); > > goto you_blew_it

Re: Try/catch for modules?

2019-10-18 Thread Ruben Safir
On 10/18/19 2:53 PM, Ruben Safir wrote: > On 10/18/19 1:05 PM, Martin Galvan wrote: >> Windows does >> with its __try/__except machinery which uses stack unwinding >> information. > > Nothing would suprise we with MS. > > Interesting. Show me a code example for this within the MS WIndows kernel

Re: Try/catch for modules?

2019-10-18 Thread Ruben Safir
On 10/18/19 1:05 PM, Martin Galvan wrote: > Windows does > with its __try/__except machinery which uses stack unwinding > information. Nothing would suprise we with MS. Interesting. Show me a code example for this within the MS WIndows kernel -- So many immigrant groups have swept through ou

Re: Try/catch for modules?

2019-10-18 Thread Ruben Safir
On 10/18/19 1:05 PM, Martin Galvan wrote: > El vie., 18 oct. 2019 a las 14:02, Ruben Safir () > escribió: >> I don't think you really understand what is going on here. On the >> kernel level you would never wrap up a process in another process in >> order to catch a mistake, and then do error co

Re: Try/catch for modules?

2019-10-18 Thread Ruben Safir
On 10/18/19 11:43 AM, Martin Galvan wrote: > goto statements are harmful not in the kernel. -- So many immigrant groups have swept through our town that Brooklyn, like Atlantis, reaches mythological proportions in the mind of the world - RI Safir 1998 http://www.mrbrklyn.com DRM is THEFT - We a

Re: Try/catch for modules?

2019-10-18 Thread Martin Galvan
El vie., 18 oct. 2019 a las 14:02, Ruben Safir () escribió: > I don't think you really understand what is going on here. On the > kernel level you would never wrap up a process in another process in > order to catch a mistake, and then do error correction. That method of > programming is not appr

Re: Try/catch for modules?

2019-10-18 Thread Ruben Safir
On Fri, Oct 18, 2019 at 01:11:54PM -0300, Martin Galvan wrote: > El vie., 18 oct. 2019 a las 13:05, Bernd Petrovitsch > () escribió: > > You actually want speed in the kernel and not necessarily extra effort > > for "try" and "catch" which is - sooner or later - never really used. > > And the "safe

Re: Try/catch for modules?

2019-10-18 Thread Bernd Petrovitsch
On 18/10/2019 18:11, Martin Galvan wrote: > El vie., 18 oct. 2019 a las 13:05, Bernd Petrovitsch > () escribió: >> You actually want speed in the kernel and not necessarily extra effort >> for "try" and "catch" which is - sooner or later - never really used. Just brainstorming (as I'm not a guru o

Re: Try/catch for modules?

2019-10-18 Thread Martin Galvan
El vie., 18 oct. 2019 a las 13:05, Bernd Petrovitsch () escribió: > You actually want speed in the kernel and not necessarily extra effort > for "try" and "catch" which is - sooner or later - never really used. > And the "safety net" reduces the motivation to actually fix pointer bugs I don't

Re: Try/catch for modules?

2019-10-18 Thread Bernd Petrovitsch
On 18/10/2019 17:43, Martin Galvan wrote:> El jue., 17 oct. 2019 a las 19:13, Valdis Klētnieks > () escribió: >> >> For starters, the *correct* in-kernel way to deal with this is: >> if (!ptr) { >> printk("You blew it!\n"); >> goto you_blew_it; >> }

Re: Try/catch for modules?

2019-10-18 Thread Anuz Pratap Singh Tomar
On Fri, Oct 18, 2019 at 4:44 PM Martin Galvan wrote: > El jue., 17 oct. 2019 a las 19:13, Valdis Klētnieks > () escribió: > > > > For starters, the *correct* in-kernel way to deal with this is: > > if (!ptr) { > > printk("You blew it!\n"); > > goto you_blew

Re: Try/catch for modules?

2019-10-18 Thread Maria Neptune
Edsger Dijkstra will haunt is forever, it seems. Gotos are just a tool, and this is one of the few places they're the best tool for the job. And generally in-kernel the acceptable method is to not forget a null check, as Valdis mentioned. It's cool to forget a null check on your own machine (who a

Re: Try/catch for modules?

2019-10-18 Thread Martin Galvan
El jue., 17 oct. 2019 a las 19:13, Valdis Klētnieks () escribió: > > For starters, the *correct* in-kernel way to deal with this is: > if (!ptr) { > printk("You blew it!\n"); > goto you_blew_it; > } goto statements are harmful. In any case, what I me