Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp2410843iob; Fri, 20 May 2022 08:47:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxD28YSbho8u+eiToWwxnoUR/gHPTqDC+sdMCelXsBV65gmnsWSiNDySEZ7VAGU2iK1rKBS X-Received: by 2002:a17:903:1104:b0:15f:bce:1a0c with SMTP id n4-20020a170903110400b0015f0bce1a0cmr9988471plh.149.1653061652737; Fri, 20 May 2022 08:47:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653061652; cv=none; d=google.com; s=arc-20160816; b=pyoGgdaC/jPhu/HM+u6QT1hRHNkmJEGoAAligJjtt4JhMvUS/P+MK1ljvvNwg7kwwZ mRPtOYYu/XmcFkwMRMwnONrmb7NArdXlgIeT43q67rTaeefmJbb1xU6/uI4xrylewjiX EdxrRbd+ftGzqhzU6m0oKqDbmW2RZcUocvpCAuG+QcX4d1WO02yQ1UtCImKXd4bdtc2q oxa6WzCmx6W8IUXdvKk7TivMdtd7zhvrr+icVgf412GG/+r1PntUD9Zg7u3WO2Ayfzoa orjSvkRq5OMwOWOyu22W0PfbA5fl8fAM49I0L+bWdkJ4QqFLyjrVkHqJQT/dhZt/lAtZ kbug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=yE2PbTqRpDymDYivezQVeunCA9NMPzja3YRE39MaMNc=; b=ymhe6fcxtXIJaVcFl0mqKwLhdhswjfvvI1ruCpUx3s2AT6m/cSJ7dwgtXGB9XLajNV VyZhv+iONjEyxYf7vGivbXEmnyBHfif/UW1NjpYqnYKtw3C8sFMsBA2YCr3/U0TN7Lld 95blCpBSmV0OsuAfxuZRk4KNlyc0WWSVBwAOiVJYLkFRkWHmaZM8qL7T2/KTH3Xn7vKK XUNb/JmUqYoGMFLvRBJ/GR5J3wMOJmX0MRkQTmmYr/BaL8c1AeR7wkSp0NKws9QtTFMl I8HFMrY9jTdWseuWnDWwmuD8nM9F0zKgpgK8q9l9cJDlPa//2zEH6vx2oqGINAkek95N 4jcA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=LA+PxGDE; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u12-20020a170903124c00b00158f817a27bsi12165717plh.148.2022.05.20.08.47.09; Fri, 20 May 2022 08:47:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-nfs-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=@redhat.com header.s=mimecast20190719 header.b=LA+PxGDE; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1348340AbiETLEJ (ORCPT + 99 others); Fri, 20 May 2022 07:04:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33540 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1348312AbiETLEH (ORCPT ); Fri, 20 May 2022 07:04:07 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 8190C149AA1 for ; Fri, 20 May 2022 04:04:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1653044645; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=yE2PbTqRpDymDYivezQVeunCA9NMPzja3YRE39MaMNc=; b=LA+PxGDEAxYRGAghvMq6YN6OJjuJnkti1RkR1C0vN7bKtbz3tUcgyEfBmFu/b0u9WNgjom RlEu26xmBXIqkNEhlgjVQf0TvIc6jt0qWT3UTAqTGjxv4j/c89jQr81W5h99aOHcvc3QgN 0C57rVjPUCLoBHG/OcP3gguti8TV0ik= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-288-XpSnvcZjN-6UF4mTo4PINw-1; Fri, 20 May 2022 07:04:02 -0400 X-MC-Unique: XpSnvcZjN-6UF4mTo4PINw-1 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 9D16829AB3F5; Fri, 20 May 2022 11:04:01 +0000 (UTC) Received: from [172.16.176.1] (ovpn-64-66.rdu2.redhat.com [10.10.64.66]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 51DD4492C3B; Fri, 20 May 2022 11:04:01 +0000 (UTC) From: "Benjamin Coddington" To: "Javier Abrego" Cc: trond.myklebust@hammerspace.com, anna@kernel.org, linux-nfs@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] nfs: removed goto statement Date: Fri, 20 May 2022 07:04:00 -0400 Message-ID: In-Reply-To: <20220520085019.44138-1-javier.abrego.lorente@gmail.com> References: <20220520085019.44138-1-javier.abrego.lorente@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; format=flowed X-Scanned-By: MIMEDefang 2.85 on 10.11.54.9 X-Spam-Status: No, score=-3.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, SPF_HELO_NONE,SPF_NONE,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-nfs@vger.kernel.org On 20 May 2022, at 4:50, Javier Abrego wrote: > In this function goto can be replaced. Avoiding goto will improve the > readability > > Signed-off-by: Javier Abrego > --- > fs/nfs/nfs42xattr.c | 28 +++++++++++++--------------- > 1 file changed, 13 insertions(+), 15 deletions(-) > > diff --git a/fs/nfs/nfs42xattr.c b/fs/nfs/nfs42xattr.c > index e7b34f7e0..9bf3a88fd 100644 > --- a/fs/nfs/nfs42xattr.c > +++ b/fs/nfs/nfs42xattr.c > @@ -747,21 +747,19 @@ void nfs4_xattr_cache_set_list(struct inode > *inode, const char *buf, > return; > > entry = nfs4_xattr_alloc_entry(NULL, buf, NULL, buflen); > - if (entry == NULL) > - goto out; > - > - /* > - * This is just there to be able to get to bucket->cache, > - * which is obviously the same for all buckets, so just > - * use bucket 0. > - */ > - entry->bucket = &cache->buckets[0]; > - > - if (!nfs4_xattr_set_listcache(cache, entry)) > - kref_put(&entry->ref, nfs4_xattr_free_entry_cb); > - > -out: > - kref_put(&cache->ref, nfs4_xattr_free_cache_cb); > + if (entry == NULL) { > + kref_put(&cache->ref, nfs4_xattr_free_cache_cb); > + } else { > + /* > + * This is just there to be able to get to bucket->cache, > + * which is obviously the same for all buckets, so just > + * use bucket 0. > + */ > + entry->bucket = &cache->buckets[0]; > + > + if (!nfs4_xattr_set_listcache(cache, entry)) > + kref_put(&entry->ref, nfs4_xattr_free_entry_cb); > + } > } > > /* > -- > 2.25.1 No, NACK because you removed the kref_put of cache->ref. I find this function quite readable as it is. Ben