From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932339AbcGFRtv (ORCPT ); Wed, 6 Jul 2016 13:49:51 -0400 Received: from smtprelay0134.hostedemail.com ([216.40.44.134]:58650 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S932235AbcGFRtt (ORCPT ); Wed, 6 Jul 2016 13:49:49 -0400 X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,joe@perches.com,:::::::,RULES_HIT:41:355:379:541:599:968:973:988:989:1260:1277:1311:1313:1314:1345:1359:1373:1437:1515:1516:1518:1534:1541:1593:1594:1711:1730:1747:1777:1792:2393:2559:2562:2828:3138:3139:3140:3141:3142:3151:3352:3622:3865:3867:3868:3872:3873:3874:4250:4321:5007:7903:8527:10004:10400:10848:11026:11232:11473:11658:11783:11889:11914:12043:12296:12438:12517:12519:12740:13069:13311:13357:13439:13894:14181:14659:14721:21080,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fn,MSBL:0,DNSBL:none,Custom_rules:0:0:0,LFtime:21,LUA_SUMMARY:none X-HE-Tag: match96_3835fd6a35c01 X-Filterd-Recvd-Size: 2135 Message-ID: <1467827385.8360.30.camel@perches.com> Subject: Re: [PATCH -next] orangefs: use vzalloc() instead of vmalloc()/memset(0) From: Joe Perches To: Mike Marshall , weiyj_lk@163.com Cc: Wei Yongjun , LKML Date: Wed, 06 Jul 2016 10:49:45 -0700 In-Reply-To: References: <1467811431-2535-1-git-send-email-weiyj_lk@163.com> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.18.5.2-0ubuntu3 Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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);