Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp1328856imw; Tue, 5 Jul 2022 07:38:38 -0700 (PDT) X-Google-Smtp-Source: AGRyM1t56LYpJVxH1ESVrW1ZDoaZcYJyqOKX7xLAzy0L2OfVJl0KFpSrTtz66LSL7sT2afKZvL8x X-Received: by 2002:a17:90b:4d01:b0:1ef:54e4:f840 with SMTP id mw1-20020a17090b4d0100b001ef54e4f840mr29546343pjb.216.1657031918403; Tue, 05 Jul 2022 07:38:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657031918; cv=none; d=google.com; s=arc-20160816; b=eXlIQ56+17nvCY5C06NsgJL/V4rj4Zb/hi3/K2iHESPsTBSlMTKaXi8XCoMlW5V/6c gM6AYqKj183Q2xwyjHGtOOMetfm/06/t0kV1gy5Fxd5rwS/aReNfLHK0tPAeHcdO5Xm1 g82WSKBm0cHCDkW9g3qMnxCUrrnwai5qF/pv5uVp7EgmwXNt93O1cLTeWLVnTKt7NYe4 Eu8MxDvEiBVFPeVmwwt81anPKixXc14OU19yyVg7ZhtwBMpX14T2muZhdPwDOFzqVDb/ zOoK+XtUA9+SV0IoVoae1zBE5DyI08obJoeA9Ged5XYa4NBTP/y7n2Jdku+LEY7S63tg SfkQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent :content-transfer-encoding:references:in-reply-to:date:cc:to:from :subject:message-id:dkim-signature; bh=A18HUJn8PYgHyvn+0151rX9Cv4LBT4eqNsdto2N2zq4=; b=T0GvPpcrdiuouIw7fRxZQnmyOE2+gBo6/HQ8s31ewaWpKs4KpdVFJq7BhKiDjRfLW7 H7o5s0dMGzXIS4Lqw4f84+b/1bNxaR8FsBV1U5Qr27V+ccVtF5M/wuCqtQqAUtZnuSBI imBgjSNkfinbNI8iq7b0QT+HEVoRvMZi0IDGEDPw9k9PQOMikCkyOCSFa+AAhsfdPkCx x12vGX3HtRmTjI1cbsM7qCl0oo6MwO7Om8Yi3O2yqrjgFPlPB7irtkoISRTh/h+LKONn Y74PCNN8gE4YAWhAw6D8lkTIVOeRx1HmWb/97Oj69ZT87hoLWXOQU7BFXpiS6bwPA57W 7RUw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="J7JvST/3"; 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 r193-20020a632bca000000b004114fd8e9a9si27527536pgr.825.2022.07.05.07.38.26; Tue, 05 Jul 2022 07:38:38 -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="J7JvST/3"; 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 S232575AbiGEN6Z (ORCPT + 99 others); Tue, 5 Jul 2022 09:58:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47166 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233383AbiGEN5l (ORCPT ); Tue, 5 Jul 2022 09:57:41 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 66E7A1CFEF; Tue, 5 Jul 2022 06:41:30 -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 0CC0B61722; Tue, 5 Jul 2022 13:41:30 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7ACE6C341C7; Tue, 5 Jul 2022 13:41:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1657028489; bh=aHlxnEAEQM5r6al9d8XqU+n34AltTALTHE2pF/9B8lI=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=J7JvST/3EoYyCBzmIrNNK8lBxeod3pxrE04YCmrnKfGau5/Ywkzei/+R8GHabJptP NqUvnOpPczK7lwWhu7xAw7H9azruDWObVf6DifUGWpHhDv/kKhHe449hzAZWXK/ZSn tbBh6hruWOVPYmS2Z/VB5M1iUmhevDHzxPQyeJNGvmigszYPlx3S/M1UvaImncqlN8 WBtcYQxBQSmwTUEXT7JE/fLUKjTlQoLjREBMZcUiTU4dF/0xul8NJjMB4WbCdDfg4w dUzdKzGNWn4S4KghttEf267tG2MoiTBMaTIWCRuEY+CvlZ4utP1Z7itlE2WVkIF0Uk ks2SsSTBr7+ZQ== Message-ID: <459eec8a5cd41316aedbff6287900cd92ff92b52.camel@kernel.org> Subject: Re: [PATCH 1/2] netfs: release the folio lock and put the folio before retrying From: Jeff Layton To: David Howells Cc: 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 Date: Tue, 05 Jul 2022 09:41:25 -0400 In-Reply-To: <2187946.1657027284@warthog.procyon.org.uk> References: <30a4bd0e19626f5fb30f19f0ae70fba2debb361a.camel@kernel.org> <20220701022947.10716-1-xiubli@redhat.com> <20220701022947.10716-2-xiubli@redhat.com> <2187946.1657027284@warthog.procyon.org.uk> Content-Type: text/plain; charset="ISO-8859-15" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.44.2 (3.44.2-1.fc36) MIME-Version: 1.0 X-Spam-Status: No, score=-7.8 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 Tue, 2022-07-05 at 14:21 +0100, David Howells wrote: > Jeff Layton wrote: >=20 > > I don't know here... I think it might be better to just expect that whe= n > > 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. >=20 > I seem to remember there was some reason you wanted the folio unlocking a= nd > putting. I guess you need to drop the ref to flush it. >=20 > Would it make sense for ->check_write_begin() to be passed a "struct foli= o > **folio" rather than "struct folio *folio" and then the filesystem can cl= ear > *folio if it disposes of the page? >=20 I'd be OK with that too. --=20 Jeff Layton