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 3F3EAC54EED for ; Sun, 22 Jan 2023 01:06:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229760AbjAVBGq (ORCPT ); Sat, 21 Jan 2023 20:06:46 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43266 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229463AbjAVBGp (ORCPT ); Sat, 21 Jan 2023 20:06:45 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 67BF022DD0; Sat, 21 Jan 2023 17:06:43 -0800 (PST) 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 F3BDE60918; Sun, 22 Jan 2023 01:06:42 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id F310CC433D2; Sun, 22 Jan 2023 01:06:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1674349602; bh=f++QpVWpQpCa5Y2lUzhkXb5vN7dWMnG6EbTBZMDoyqE=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=K8ITSredLjN6RsWmDw7F2N5WthD7EgH6VTWaz2+ik16Ka/pQziEgWZn04WqCXW071 r9erU5+Z1B/9XVDshRwPjHKsFWahHPGqUMQB+YcCLd2gj1WLD9x48LlmxmE5voLZAV 4SleWXBskXm0bHHmpptYnTnhCBrc4uX5NActjowk= Date: Sat, 21 Jan 2023 17:06:41 -0800 From: Andrew Morton To: Christoph Hellwig Cc: Matthew Wilcox , Hugh Dickins , linux-afs@lists.infradead.org, linux-btrfs@vger.kernel.org, linux-ext4@vger.kernel.org, cluster-devel@redhat.com, linux-mm@kvack.org, linux-xfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-nilfs@vger.kernel.org Subject: Re: return an ERR_PTR from __filemap_get_folio v2 Message-Id: <20230121170641.121f4224a0e8304765bb4738@linux-foundation.org> In-Reply-To: <20230121065755.1140136-1-hch@lst.de> References: <20230121065755.1140136-1-hch@lst.de> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.33; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org On Sat, 21 Jan 2023 07:57:48 +0100 Christoph Hellwig wrote: > Hi all, > > __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. > > Note that the shmem patches in here are non-trivial and need some > careful review and testing. I'll hide for a while, awaiting that review. Plus... > Changes since v1: > - drop the patches to check for errors in btrfs and gfs2 > - document the new calling conventions for the wrappers around > __filemap_get_folio > - rebased against the iomap changes in latest linux-next This patchset doesn't apply to fs/btrfs/ because linux-next contains this 6+ month-old commit: commit 964688b32d9ada55a7fce2e650d85ef24188f73f Author: Matthew Wilcox (Oracle) AuthorDate: Tue May 17 18:03:27 2022 -0400 Commit: Matthew Wilcox (Oracle) CommitDate: Wed Jun 29 08:51:07 2022 -0400 btrfs: Use a folio in wait_dev_supers() Matthew, what's the story here? From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Morton Date: Sat, 21 Jan 2023 17:06:41 -0800 Subject: [Cluster-devel] return an ERR_PTR from __filemap_get_folio v2 In-Reply-To: <20230121065755.1140136-1-hch@lst.de> References: <20230121065755.1140136-1-hch@lst.de> Message-ID: <20230121170641.121f4224a0e8304765bb4738@linux-foundation.org> List-Id: To: cluster-devel.redhat.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit On Sat, 21 Jan 2023 07:57:48 +0100 Christoph Hellwig wrote: > Hi all, > > __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. > > Note that the shmem patches in here are non-trivial and need some > careful review and testing. I'll hide for a while, awaiting that review. Plus... > Changes since v1: > - drop the patches to check for errors in btrfs and gfs2 > - document the new calling conventions for the wrappers around > __filemap_get_folio > - rebased against the iomap changes in latest linux-next This patchset doesn't apply to fs/btrfs/ because linux-next contains this 6+ month-old commit: commit 964688b32d9ada55a7fce2e650d85ef24188f73f Author: Matthew Wilcox (Oracle) AuthorDate: Tue May 17 18:03:27 2022 -0400 Commit: Matthew Wilcox (Oracle) CommitDate: Wed Jun 29 08:51:07 2022 -0400 btrfs: Use a folio in wait_dev_supers() Matthew, what's the story here? From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Morton Subject: Re: return an ERR_PTR from __filemap_get_folio v2 Date: Sat, 21 Jan 2023 17:06:41 -0800 Message-ID: <20230121170641.121f4224a0e8304765bb4738@linux-foundation.org> References: <20230121065755.1140136-1-hch@lst.de> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Return-path: DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1674349602; bh=f++QpVWpQpCa5Y2lUzhkXb5vN7dWMnG6EbTBZMDoyqE=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=K8ITSredLjN6RsWmDw7F2N5WthD7EgH6VTWaz2+ik16Ka/pQziEgWZn04WqCXW071 r9erU5+Z1B/9XVDshRwPjHKsFWahHPGqUMQB+YcCLd2gj1WLD9x48LlmxmE5voLZAV 4SleWXBskXm0bHHmpptYnTnhCBrc4uX5NActjowk= In-Reply-To: <20230121065755.1140136-1-hch-jcswGhMUV9g@public.gmane.org> List-ID: Content-Type: text/plain; charset="us-ascii" To: Christoph Hellwig Cc: Matthew Wilcox , Hugh Dickins , linux-afs-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org, linux-btrfs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-ext4-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, cluster-devel-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org, linux-mm-Bw31MaZKKs3YtjvyW6yDsg@public.gmane.org, linux-xfs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-fsdevel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-nilfs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org On Sat, 21 Jan 2023 07:57:48 +0100 Christoph Hellwig wrote: > Hi all, > > __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. > > Note that the shmem patches in here are non-trivial and need some > careful review and testing. I'll hide for a while, awaiting that review. Plus... > Changes since v1: > - drop the patches to check for errors in btrfs and gfs2 > - document the new calling conventions for the wrappers around > __filemap_get_folio > - rebased against the iomap changes in latest linux-next This patchset doesn't apply to fs/btrfs/ because linux-next contains this 6+ month-old commit: commit 964688b32d9ada55a7fce2e650d85ef24188f73f Author: Matthew Wilcox (Oracle) AuthorDate: Tue May 17 18:03:27 2022 -0400 Commit: Matthew Wilcox (Oracle) CommitDate: Wed Jun 29 08:51:07 2022 -0400 btrfs: Use a folio in wait_dev_supers() Matthew, what's the story here?