Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp937393rwe; Thu, 1 Sep 2022 09:47:54 -0700 (PDT) X-Google-Smtp-Source: AA6agR6ME8gxm3swS8zDOYexNuuSI0GsXkRwNgvgKGY46MxifjyMn46LSKC0gODOd2r4LQ4gUQ+/ X-Received: by 2002:a05:6402:11d1:b0:43e:33b:93fa with SMTP id j17-20020a05640211d100b0043e033b93famr30318523edw.419.1662050874371; Thu, 01 Sep 2022 09:47:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662050874; cv=none; d=google.com; s=arc-20160816; b=M8M54rJS41ChBLTcZMbWbiBIXsSm9EEBFBNugOeYPQPHQbNnxuiMYT8pKg5sPUy4uz yDFkcFBH55Nktt1Ok+Q62P5oM37e9LCOBUkxCukgAmHdctj27TfUhDe3Tkue4nlJnsQl BQfqRlqT8PUOTsiA75Ysoo1MpWzV85vkHHnHhHOsiOStNIVOKrf5J/m52yQ29RqCpXur Qx0s+QyVTjbbNLaKLC4Zj03rcMZurBwh6jqOMZp1MOaLEpFEqTT8nYaOVRHSEObcKca7 azb5NdowVNB58qLskSg+75sotgVgZcXe02ktazlxIxpl/KW4jkJnRhu7QMTOD7z4JCLP /y2g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=120i5tc2b4eSs6xkTYKmAfebkFvPZvFQJ8EZ8U6CORQ=; b=tQOx8kF7lyDHt4OT8hOjzoP2A3D6xA9HbkkaegyhGCPxHmqroM+w7S+rGCX7dtfaeF ui+eThrnGIb/U0IzJDJd1OCjotN4vODM4E5lIUEfydBzXvK5OyDRuZ61ftAlkGjybsn4 Jqgy+dXbd3jiKw5NSlqdkgiwj7teqqOlEm8zdQmbbAe1XFdDb8B28lfEQLXBD5bR5qrP mcpte+lNy/QD9Sfqa6P9mnKf6zyPkdkSYzCJZNbfv6jEr2JAjaU3JHbdSE5z5x1+JvUK LHyOZP7NWgErfCrkLe9gLEUQ0E4D10K7ZvPnjgUtxrwUpvq/nwHxjOMlJwH452ai0Hg4 7KBA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="CUBOtS/n"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id qb1-20020a1709077e8100b0073065ea79bfsi13639683ejc.528.2022.09.01.09.47.27; Thu, 01 Sep 2022 09:47:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="CUBOtS/n"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234874AbiIAQIy (ORCPT + 99 others); Thu, 1 Sep 2022 12:08:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36536 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234919AbiIAQIi (ORCPT ); Thu, 1 Sep 2022 12:08:38 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 96CE3923FA; Thu, 1 Sep 2022 09:08:35 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id EE13A61F59; Thu, 1 Sep 2022 16:08:33 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 56638C433D6; Thu, 1 Sep 2022 16:08:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1662048513; bh=eIhctK8SYZVGzBDfi2TjBEV1IDQq15uxmBiHJNqgDy8=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=CUBOtS/nmF0dCFVfjIxjp4X09wVKFYTBmhLB2kLMmuwEvy326c59MNrcndkFQXEoA eL+38c3uP2GCEpfR8Z9GTuBkZCK4upmhCfTXCM6a51fAl1y426n5w5TKehuWSvT+rH FVJ7R+2zE8rNn96HutrL8tXdGbBkA0MnogLKuVAsfu7WbWl03KB30vhmh/9gY1nmbO EYzcIrjurKIemSrixbax4RCHpX8hmNh8rYktIXHFo+FX2VJotnMU2HpTgA3lvqQrRa J0n460Gj6KlNobDXmF8yiX+H1nnH+8tlJS5Ad2xanb/AlEx+jwBV6/wAg7bz7R+Rk/ 4t6ETxxSYCxKw== Date: Thu, 1 Sep 2022 09:08:32 -0700 From: "Darrick J. Wong" To: Zhiqiang Liu Cc: linux-xfs@vger.kernel.org, linux-kernel@vger.kernel.org, linfeilong , wuguanghao Subject: Re: [PATCH v2] xfs: donot need to check return value of xlog_kvmalloc() Message-ID: References: <471db2ec-8836-14f5-fb33-579b294943e9@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <471db2ec-8836-14f5-fb33-579b294943e9@huawei.com> X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Sep 01, 2022 at 10:59:08AM +0800, Zhiqiang Liu wrote: > In xfs_attri_log_nameval_alloc(), xlog_kvmalloc() is called > to alloc memory, which will always return > successfully, so we donot need to check return value. > > Reviewed-by: Eric Sandeen > Signed-off-by: Zhiqiang Liu Makes sense... Reviewed-by: Darrick J. Wong --D > --- > Changelog: > V1 -> V2: > 1.add Reviewed-by: Eric Sandeen > 2.remove santity check of xfs_attri_log_nameval_alloc() > suggested by Eric Sandeen. > > fs/xfs/xfs_attr_item.c | 6 ------ > 1 file changed, 6 deletions(-) > > diff --git a/fs/xfs/xfs_attr_item.c b/fs/xfs/xfs_attr_item.c > index 5077a7ad5646..cf5ce607dc05 100644 > --- a/fs/xfs/xfs_attr_item.c > +++ b/fs/xfs/xfs_attr_item.c > @@ -86,8 +86,6 @@ xfs_attri_log_nameval_alloc( > */ > nv = xlog_kvmalloc(sizeof(struct xfs_attri_log_nameval) + > name_len + value_len); > - if (!nv) > - return nv; > > nv->name.i_addr = nv + 1; > nv->name.i_len = name_len; > @@ -441,8 +439,6 @@ xfs_attr_create_intent( > attr->xattri_nameval = xfs_attri_log_nameval_alloc(args->name, > args->namelen, args->value, args->valuelen); > } > - if (!attr->xattri_nameval) > - return ERR_PTR(-ENOMEM); > > attrip = xfs_attri_init(mp, attr->xattri_nameval); > xfs_trans_add_item(tp, &attrip->attri_item); > @@ -762,8 +758,6 @@ xlog_recover_attri_commit_pass2( > nv = xfs_attri_log_nameval_alloc(attr_name, > attri_formatp->alfi_name_len, attr_value, > attri_formatp->alfi_value_len); > - if (!nv) > - return -ENOMEM; > > attrip = xfs_attri_init(mp, nv); > error = xfs_attri_copy_format(&item->ri_buf[0], &attrip->attri_format); > -- > 2.33.0 >