Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp3699884imw; Thu, 7 Jul 2022 06:19:10 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tV/kFt6G016VPnBd/awO9Er1YK4HXI7muHSQzQ2pGcnOWxkjcdpxUS+9xyrflgMkTiKHUr X-Received: by 2002:a17:902:cf11:b0:16b:e1a5:aee with SMTP id i17-20020a170902cf1100b0016be1a50aeemr23405331plg.132.1657199949887; Thu, 07 Jul 2022 06:19:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657199949; cv=none; d=google.com; s=arc-20160816; b=vH61Nt/P4K/ZJYVGPoJ0HTob/tHJHKBBehrOZOofutMbH23airmbTChIFq5y1ym7Wf RyzJJUSLhhoW9M5ll5GYKGFV3AjjeVYz17jEhSY0mVu04Sxb7MHL9F08lFzQadTH19C9 FN692BmRYepduxxTILSPJM44GchlPMhmv1Yvz0Kr7xg02FKDtSwDxWoogyPA/oM52lYq aywAfGdqITL3fcw0tUTiTu/Akco3KPHT0ZjqrP9729s963JfVLPfE1U52Zy9iQ0X5UMX olqdlnV7jc18Yq3HBo/c3AzZsRkvQT6S1Y+10qVpuH10c5javroCHpRsWKMc2w2bMNJ0 Yn7g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:content-id:mime-version:subject :cc:to:references:in-reply-to:from:organization:dkim-signature; bh=qw238l4/II5ZS2Jgu7adObRZNkiqO5QpfrDEC+afXgc=; b=FnVfKOjyM2jDaJgAwqFOsol5dcI2AHvjvzIxP4MmMGe06hXjDeYkewVZR8cMFIGF+2 Up4Kd9jai3Gfo/vRORLb1FpWmGx3n8IIS6/yl+EPZZQ5Pz8IQWOSgYRPYw1UJjveD6rr xPz+JNBrq+9wVLWd7NDFo8Ay5XP2yN0HSGKo/j+DKnD62pc/mozCjb0bEDHUCyU1792f /5qM8Q8zEv4esLjDEQ17Je6mcIuoWi1TO0UAnWXCoUS35SXEGeLVRVQDFd1FQPkDn3PW w2P0dg8NC+ZL8D4bexhec3IaUf2V8B/xoi0pSyTCkWzZUl2fF9vvSDCZq+tABYKtuM/J 6lzQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=fFOB5FpG; 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=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w16-20020a631610000000b004126f260640si11251349pgl.128.2022.07.07.06.18.49; Thu, 07 Jul 2022 06:19:09 -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=@redhat.com header.s=mimecast20190719 header.b=fFOB5FpG; 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=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235845AbiGGMxv (ORCPT + 99 others); Thu, 7 Jul 2022 08:53:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46164 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235844AbiGGMxZ (ORCPT ); Thu, 7 Jul 2022 08:53:25 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id D71FB2F384 for ; Thu, 7 Jul 2022 05:53:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1657198401; 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=qw238l4/II5ZS2Jgu7adObRZNkiqO5QpfrDEC+afXgc=; b=fFOB5FpGYrx3JdZB+NZteMFDyH5pqeqVbktL5Vq3ojCR8rVMpzV6flgz4SD28QFl1RTDsn BcmeeW4lmnODI4FOlda2JDjoxB18EoE0U/fpcGkSlCjZxoULx5NVJ3bU7wxBPJdG1ZrVoM jSqhVIV+g40LvhcQeiQ86oKv9f+kOf8= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-197-MpSypgCmMdKepNO5kg5jzw-1; Thu, 07 Jul 2022 08:53:18 -0400 X-MC-Unique: MpSypgCmMdKepNO5kg5jzw-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 1490A80A0C5; Thu, 7 Jul 2022 12:53:18 +0000 (UTC) Received: from warthog.procyon.org.uk (unknown [10.33.37.50]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7CE17404C321; Thu, 7 Jul 2022 12:53:16 +0000 (UTC) Organization: Red Hat UK Ltd. Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SI4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 3798903 From: David Howells In-Reply-To: <20220707045112.10177-2-xiubli@redhat.com> References: <20220707045112.10177-2-xiubli@redhat.com> <20220707045112.10177-1-xiubli@redhat.com> To: xiubli@redhat.com Cc: dhowells@redhat.com, idryomov@gmail.com, jlayton@kernel.org, marc.dionne@auristor.com, willy@infradead.org, keescook@chromium.org, kirill.shutemov@linux.intel.com, william.kucharski@oracle.com, linux-afs@lists.infradead.org, linux-kernel@vger.kernel.org, ceph-devel@vger.kernel.org, linux-cachefs@redhat.com, vshankar@redhat.com Subject: Re: [PATCH v3 1/2] netfs: do not unlock and put the folio twice MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <2435747.1657198395.1@warthog.procyon.org.uk> Date: Thu, 07 Jul 2022 13:53:15 +0100 Message-ID: <2435748.1657198395@warthog.procyon.org.uk> X-Scanned-By: MIMEDefang 2.84 on 10.11.54.1 X-Spam-Status: No, score=-3.5 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=unavailable 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 xiubli@redhat.com wrote: > -error: > +error_locked: > folio_unlock(folio); > folio_put(folio); > +error_unlocked: I would do: error: if (folio) { folio_unlock(folio); folio_put(folio); } David