Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp1330724imw; Tue, 5 Jul 2022 07:40:46 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vRAAzC7fr8D1jYIhdZT7mzLZf74ua9sljFExS3ozImkjmgfDYNlqNQWXUZw4luO/I+m+ZP X-Received: by 2002:a17:902:e810:b0:16a:2934:c8f7 with SMTP id u16-20020a170902e81000b0016a2934c8f7mr42147369plg.171.1657032045903; Tue, 05 Jul 2022 07:40:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657032045; cv=none; d=google.com; s=arc-20160816; b=JYOWEVbn0A1AilRGJhh4ry3ciw+Y4ai4elufkhEtAg6/+LfDZ0Ucz7FXvA34Xq4/tI boWQ2imFwXnllyXBkfcuOfw8uJD95Egek/2NKIWwQhXuPoynReOAugqs42vn08gJxWZS IXrg4xjZfwmvSGJ8ExufEBt4sXWxHGFpQQLQU/PCe+ay+YcvAhJ8HolnO9ArWtD/IaH9 aLcZjpRpW/zh+RtIrlLNdcIq7D3nOt/Jf9vr0lX0/7hfHSWP7xs376S1bAvifbsD3xZw Lebf6qaaMaYtJa0SY/wSzI6GQzj1G/WwOG20ILp6EAo4rltwbj/LuBSCfsaT9dELkgVm /oSw== 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=IU1hmx/6CablWOPeTIIqi3YqGNsqAV5xUAc3aVqmUGg=; b=nZDCcy8Dp6zSObMN+Wk5wYSpDGwID1ob3Nz8II6dFWFNBvQAuJRA4t0IUc6qTqAXI2 +BsioOfXn3Ph2SqM2Z/P6npkcHdToHv+gpuD+tXWt9WGJWTbPSPNao/O7L2tMPj31sYW 3Yq2N1P/8LT2y2wcwGYSikiOWFPDaEcTrdrEF+JlM36DwYEQpRL/yP0DjuFSaiKPNw3T LKL5UdwUno/ro7ECNFLOhS8vAQkmRsOgIhKqQFR121Dgo+qULALAn6+XpNxCu/Ee6fJp b5xJF6qzmouWryMoxVX66v0Y7wlrRLc98OkvlZ/hmQJd2hHrDBmXhCuSTCkLngTFEJwe Ed/A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=G4SIq8KK; 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 y12-20020a17090322cc00b0016a71859688si1226207plg.599.2022.07.05.07.40.33; Tue, 05 Jul 2022 07:40:45 -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=G4SIq8KK; 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 S232806AbiGENuJ (ORCPT + 99 others); Tue, 5 Jul 2022 09:50:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37442 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229983AbiGENt3 (ORCPT ); Tue, 5 Jul 2022 09:49:29 -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 F34DC2FE56 for ; Tue, 5 Jul 2022 06:21:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1657027287; 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=IU1hmx/6CablWOPeTIIqi3YqGNsqAV5xUAc3aVqmUGg=; b=G4SIq8KKzdy+sq7Fikhd2d6RNG46DjX4ejRk1qsWaU6vFGCVKCQjgAl9hwk47TiRVCngah Tccfkhpg0RbAz7q7loNU/oW9MiSED0Lc4gOL3SlQKVGxDuGEJT19zKFjSeQt2DtoR8uEfB JRmSgq0PQJtUheJaBCQ48xzfT5HWSpQ= 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-77--JCJQmBOMB2CUtYwGYxzUw-1; Tue, 05 Jul 2022 09:21:26 -0400 X-MC-Unique: -JCJQmBOMB2CUtYwGYxzUw-1 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 0964F811E7A; Tue, 5 Jul 2022 13:21:26 +0000 (UTC) Received: from warthog.procyon.org.uk (unknown [10.33.37.50]) by smtp.corp.redhat.com (Postfix) with ESMTP id BCF03416390; Tue, 5 Jul 2022 13:21:24 +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: <30a4bd0e19626f5fb30f19f0ae70fba2debb361a.camel@kernel.org> References: <30a4bd0e19626f5fb30f19f0ae70fba2debb361a.camel@kernel.org> <20220701022947.10716-1-xiubli@redhat.com> <20220701022947.10716-2-xiubli@redhat.com> To: Jeff Layton Cc: dhowells@redhat.com, xiubli@redhat.com, idryomov@gmail.com, vshankar@redhat.com, linux-kernel@vger.kernel.org, ceph-devel@vger.kernel.org, willy@infradead.org, keescook@chromium.org, linux-fsdevel@vger.kernel.org, linux-cachefs@redhat.com Subject: Re: [PATCH 1/2] netfs: release the folio lock and put the folio before retrying MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <2187945.1657027284.1@warthog.procyon.org.uk> Date: Tue, 05 Jul 2022 14:21:24 +0100 Message-ID: <2187946.1657027284@warthog.procyon.org.uk> X-Scanned-By: MIMEDefang 2.85 on 10.11.54.10 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=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 Jeff Layton wrote: > I don't know here... I think it might be better to just expect that when > this function returns an error that the folio has already been unlocked. > Doing it this way will mean that you will lock and unlock the folio a > second time for no reason. I seem to remember there was some reason you wanted the folio unlocking and putting. I guess you need to drop the ref to flush it. Would it make sense for ->check_write_begin() to be passed a "struct folio **folio" rather than "struct folio *folio" and then the filesystem can clear *folio if it disposes of the page? David