lkml.org 
[lkml]   [2013]   [Oct]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] [workqueue] check values of pwq and wq in print_worker_info() before use
On Tue, Oct 01, 2013 at 05:03:48PM -0400, Tejun Heo wrote:
> On Tue, Oct 01, 2013 at 10:53:31PM +0200, Helge Deller wrote:
> > So, in summary my patch here is not really necessary, but for the sake of
> > clean code I think it doesn't hurt either and as such it would be nice if
> > you could apply it.
>
> What? function *must* take any value and try to access it and not
> cause failure. That's the *whole* purpose of that interface. How is
> having incomplete spurious checks around it "clean code" in any sense
> of the word? That doesn't make any sense.

Just in case you didn't know already. probe_kernel_read()'s role is
to take any ulong value and dereference it if it can. If not, it can
return any value, but it shouldn't crash in any case. If you're just
adding NULL test in probe_kernel_read(), you're just masking a common
failure pattern and the kernel still *will* panic while dumping the
states. If a specific arch doesn't have proper probe_kernel_read()
implementation, adding if (!NULL) test there could be a temporary
workaround, but it should be clearly marked as such.

--
tejun


\
 
 \ /
  Last update: 2013-10-01 23:21    [W:0.088 / U:0.324 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site