lkml.org 
[lkml]   [2016]   [Jul]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH -next] orangefs: use vzalloc() instead of vmalloc()/memset(0)
Hi Joe...

I looked around at other code to see how they were using vzalloc...
even if it is just the caller of the function that uses vzalloc, most
fs's that use vzalloc print an error message when vzalloc fails... I sure do
like to follow the flow of our kernel module all in one place
with the gossip statements...

-Mike

On Wed, Jul 6, 2016 at 1:49 PM, Joe Perches <joe@perches.com> wrote:
> On Wed, 2016-07-06 at 13:28 -0400, Mike Marshall wrote:
>> Wei...
>>
>> I have applied your patch and tested it, it seems good.
>>
>> The gossip statement still references vmalloc, I used
>> "git commit --amend" to fix that for my test. I'll do the
>> same when I push to kernel.org too, if you're OK with that,
>> unless you want to fix it yourself and resend the patch...
>
> Better still would be to remove the gossip_err() altogether
> as v.alloc already does a dump_stack on OOM.
>> > diff --git a/fs/orangefs/devorangefs-req.c b/fs/orangefs/devorangefs-req.c
> []
>> > @@ -442,14 +442,12 @@ static ssize_t orangefs_devreq_write_iter(struct kiocb *iocb,
>> > if (op->downcall.type != ORANGEFS_VFS_OP_READDIR)
>> > goto wakeup;
>> >
>> > - op->downcall.trailer_buf =
>> > - vmalloc(op->downcall.trailer_size);
>> > + op->downcall.trailer_buf = vzalloc(op->downcall.trailer_size);
>> > if (op->downcall.trailer_buf == NULL) {
>> > gossip_err("%s: failed trailer vmalloc.\n",
>> > __func__);
>> > goto Enomem;
>> > }
>> > - memset(op->downcall.trailer_buf, 0, op->downcall.trailer_size);
>

\
 
 \ /
  Last update: 2016-07-06 20:41    [W:0.041 / U:0.148 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site