lkml.org 
[lkml]   [2022]   [Jun]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v4 1/2] devcoredump: remove the useless gfp_t parameter in dev_coredumpv
Hello,

On Thu, 2 Jun 2022 13:32:48 -0700 Jeff Johnson wrote:

> On 6/2/2022 6:33 AM, Duoming Zhou wrote:
> > The dev_coredumpv() could not be used in atomic context, because
> > it calls kvasprintf_const() and kstrdup() with GFP_KERNEL parameter.
> > The process is shown below:
> >
> > dev_coredumpv(..., gfp_t gfp)
> > dev_coredumpm
> > dev_set_name
> > kobject_set_name_vargs
> > kvasprintf_const(GFP_KERNEL, ...); //may sleep
> > kstrdup(s, GFP_KERNEL); //may sleep
> >
> > This patch removes gfp_t parameter of dev_coredumpv() and changes the
> > gfp_t parameter of dev_coredumpm() to GFP_KERNEL in order to show
> > dev_coredumpv() could not be used in atomic context.
>
> shouldn't you remove the gfp parameter to dev_coredumpm() as well since
> it is actually within that function where dev_set_name() is called which
> cannot be done in atomic context?

Thanks for your suggestion, I will remove the gfp_t parameter of dev_coredumpm() as well.

Best regards,
Duoming Zhou
\
 
 \ /
  Last update: 2022-06-03 02:44    [W:0.122 / U:0.128 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site