From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id F1C59C678D5 for ; Tue, 7 Mar 2023 15:28:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230368AbjCGP2D (ORCPT ); Tue, 7 Mar 2023 10:28:03 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46864 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230408AbjCGP1h (ORCPT ); Tue, 7 Mar 2023 10:27:37 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4F0BB3E62E for ; Tue, 7 Mar 2023 07:24:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1678202667; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=49sjefw2FKulo5Vz5tQGPSxZQZKzbcJ05HQTQwuGmNA=; b=X19IFJGPk3l+C5Psr1I72T67Yxcr8Mvfksd21xHlQLwgW2mVq/MTmI2SRHpuGMUmX5IFza 0Xm2fpBlMqCfDu1XPPfDtIECBGjovTndEn1EEkGVeCbIfNjaxOrQdfbxGaSvYG008JAFpq g92anXcJmRDu+fC8yRPfHQqVtsXjjn0= Received: from mail-pl1-f199.google.com (mail-pl1-f199.google.com [209.85.214.199]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-537-UJH0YnOtOe6QHug4yLUELg-1; Tue, 07 Mar 2023 10:24:05 -0500 X-MC-Unique: UJH0YnOtOe6QHug4yLUELg-1 Received: by mail-pl1-f199.google.com with SMTP id p10-20020a170902e74a00b0019ec1acba17so3860784plf.0 for ; Tue, 07 Mar 2023 07:24:03 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678202643; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=49sjefw2FKulo5Vz5tQGPSxZQZKzbcJ05HQTQwuGmNA=; b=2rhobOsKQFuK19b4i/kv4thPJ2MHiWUdfbE+6EEf3gwCz5oJdB1fq6RGHIT0zM7sZy NhP4BFRgCv2JA1M+8J6O0b7VaeQ2YRjLDslwZISKRh20WXlG8t27s9/2MtcZHrpCuP1v gZ0pXAdM4gUaewXz6507r2Qmhxr2Al9yjsUS5RwqwnKo3DjTYUZkQsDU+pAFJ8JOC4LN gKiSNoH60c9Cif6nlHi+UGkx8LxCe65sSSAsz+rMMjZlMCw8TclOQdxBes28H4PzA9T7 CJEshVmY+9FWgwoiZIymA9DwgVfd2lbQaTJOio6F3lOzWFCbwlKUELqq1Y5h9J5TINhg jLbA== X-Gm-Message-State: AO0yUKW51VwHkz1q6B7rPO2mSCGU7Btitn3ogF4tTihyK7vk0tBCYWeB +BRROXfJ3eYvAVUeKxQf94Ek4Hj0tbozsZOMw27ktQN1Ef9NZp2JjlqWjlhUxFvPj/52SC3itow AifdZQQ4I/74CY2/FB6SkUMPlfQV1IgsF7pXxItw= X-Received: by 2002:a17:902:f812:b0:19a:f153:b73e with SMTP id ix18-20020a170902f81200b0019af153b73emr5668633plb.4.1678202642957; Tue, 07 Mar 2023 07:24:02 -0800 (PST) X-Google-Smtp-Source: AK7set9SWy5O05m3x1Ey9TSLMznr1jfUxFnvxAX39KEBXqqmaUx44UhyFFrhNGEtwClSqvzd8jjgUVc0X6h/fPAWheE= X-Received: by 2002:a17:902:f812:b0:19a:f153:b73e with SMTP id ix18-20020a170902f81200b0019af153b73emr5668618plb.4.1678202642668; Tue, 07 Mar 2023 07:24:02 -0800 (PST) MIME-Version: 1.0 References: <20230307143410.28031-1-hch@lst.de> In-Reply-To: <20230307143410.28031-1-hch@lst.de> From: Andreas Gruenbacher Date: Tue, 7 Mar 2023 16:23:50 +0100 Message-ID: Subject: Re: [Cluster-devel] return an ERR_PTR from __filemap_get_folio v3 To: Christoph Hellwig Cc: Andrew Morton , Matthew Wilcox , Hugh Dickins , linux-xfs@vger.kernel.org, linux-nilfs@vger.kernel.org, cluster-devel@redhat.com, linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, linux-ext4@vger.kernel.org, linux-afs@lists.infradead.org, linux-btrfs@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org On Tue, Mar 7, 2023 at 4:07=E2=80=AFPM Christoph Hellwig wrote= : > __filemap_get_folio and its wrappers can return NULL for three different > conditions, which in some cases requires the caller to reverse engineer > the decision making. This is fixed by returning an ERR_PTR instead of > NULL and thus transporting the reason for the failure. But to make > that work we first need to ensure that no xa_value special case is > returned and thus return the FGP_ENTRY flag. It turns out that flag > is barely used and can usually be deal with in a better way. Thanks for working on this cleanup; looking good at a first glance. Andreas From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andreas Gruenbacher Date: Tue, 7 Mar 2023 16:23:50 +0100 Subject: [Cluster-devel] return an ERR_PTR from __filemap_get_folio v3 In-Reply-To: <20230307143410.28031-1-hch@lst.de> References: <20230307143410.28031-1-hch@lst.de> Message-ID: List-Id: To: cluster-devel.redhat.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit On Tue, Mar 7, 2023 at 4:07?PM Christoph Hellwig wrote: > __filemap_get_folio and its wrappers can return NULL for three different > conditions, which in some cases requires the caller to reverse engineer > the decision making. This is fixed by returning an ERR_PTR instead of > NULL and thus transporting the reason for the failure. But to make > that work we first need to ensure that no xa_value special case is > returned and thus return the FGP_ENTRY flag. It turns out that flag > is barely used and can usually be deal with in a better way. Thanks for working on this cleanup; looking good at a first glance. Andreas From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andreas Gruenbacher Subject: Re: return an ERR_PTR from __filemap_get_folio v3 Date: Tue, 7 Mar 2023 16:23:50 +0100 Message-ID: References: <20230307143410.28031-1-hch@lst.de> Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Return-path: DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1678202847; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=49sjefw2FKulo5Vz5tQGPSxZQZKzbcJ05HQTQwuGmNA=; b=jLeRHPeHke0slPpc+64YqKo7nWYShDFUWGR9hmSxmyvLh5o+TVEwX39B8iPy0Ff+VPF8CK Db/c99noTgy3DrVgjoIpyLLiNCyHRV4r9/buwsK1FGhKY5zUEZ62DlNLu0fVA2liNtSYnN B1cJ8kv+O8Y5zTe8V3IcJFeMKP+c7i0= In-Reply-To: <20230307143410.28031-1-hch@lst.de> List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: cluster-devel-bounces@redhat.com Sender: "Cluster-devel" Content-Type: text/plain; charset="windows-1252" To: Christoph Hellwig Cc: cluster-devel@redhat.com, linux-nilfs@vger.kernel.org, Hugh Dickins , Matthew Wilcox , linux-xfs@vger.kernel.org, linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, Andrew Morton , linux-ext4@vger.kernel.org, linux-afs@lists.infradead.org, linux-btrfs@vger.kernel.org On Tue, Mar 7, 2023 at 4:07=E2=80=AFPM Christoph Hellwig wrote= : > __filemap_get_folio and its wrappers can return NULL for three different > conditions, which in some cases requires the caller to reverse engineer > the decision making. This is fixed by returning an ERR_PTR instead of > NULL and thus transporting the reason for the failure. But to make > that work we first need to ensure that no xa_value special case is > returned and thus return the FGP_ENTRY flag. It turns out that flag > is barely used and can usually be deal with in a better way. Thanks for working on this cleanup; looking good at a first glance. Andreas