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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 30CADC38142 for ; Sun, 22 Jan 2023 01:06:52 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 5D6DF6B0072; Sat, 21 Jan 2023 20:06:51 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 587166B0073; Sat, 21 Jan 2023 20:06:51 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 475746B0074; Sat, 21 Jan 2023 20:06:51 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 392586B0072 for ; Sat, 21 Jan 2023 20:06:51 -0500 (EST) Received: from smtpin03.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id 0DA211A0662 for ; Sun, 22 Jan 2023 01:06:51 +0000 (UTC) X-FDA: 80380645422.03.15FB658 Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55]) by imf17.hostedemail.com (Postfix) with ESMTP id B31924000B for ; Sun, 22 Jan 2023 01:06:47 +0000 (UTC) Authentication-Results: imf17.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=korg header.b=K8ITSred; spf=pass (imf17.hostedemail.com: domain of akpm@linux-foundation.org designates 145.40.73.55 as permitted sender) smtp.mailfrom=akpm@linux-foundation.org; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1674349608; h=from:from: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:dkim-signature; bh=Yglf5/d++AlplV9cjceQFPFA0SEgKUVwP/drqJ91jzg=; b=2GUL6t9GeLiQcEwZm2nwRnVIW5srBBgL4jwoamXmAsHYBzKoApdvLJT5DD9DctN33/6/cx UDuECT/BIst/iltfSuavrFKB3/XUEjKQoMhhyPESEVW5tAAeMMhzFsyeT2Jhqn6n62RvBs 41jt3VJtcxRmaOtr6TooWQdrMHeGYiE= ARC-Authentication-Results: i=1; imf17.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=korg header.b=K8ITSred; spf=pass (imf17.hostedemail.com: domain of akpm@linux-foundation.org designates 145.40.73.55 as permitted sender) smtp.mailfrom=akpm@linux-foundation.org; dmarc=none ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1674349608; a=rsa-sha256; cv=none; b=qVUDz9jNbWA0LQIz7yz8ky3eovdhrUp0wH5Yspzt6CBfkbLE/00jULwVbNdIRKrOpwUErp J0VynIM0dh3R7NztlhRo6X9PnE7zHSQJc/Tx2qObH8Ngzyiu84yN4zCSafTrScfdDNKhAF dPbKF4KLNfBd8i6hShOdG9+i74lR7jM= 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 sin.source.kernel.org (Postfix) with ESMTPS id 32E58CE0AF0; Sun, 22 Jan 2023 01:06:44 +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 X-Rspamd-Queue-Id: B31924000B X-Stat-Signature: k8boancw3fgbwk9z4a89nzgdwn6jor35 X-Rspam-User: X-Rspamd-Server: rspam08 X-HE-Tag: 1674349607-137260 X-HE-Meta: U2FsdGVkX18oCZDr2uBmuUbggamTqyWx4PA5NktiSoCMvWlN1CmtpfaKEZLAyJ4M65sxJ/symJi+a+qiksectaFb8jPLO5bovrcm3tGgGC3g7Vid5wNP7zE4oxoykfUhmEALWhznX8TKUtI4QEV5RYxeyQG1kHhzxjZJ+iXZ/z25ANWsrcTb57GrKZxiFaOMQCiXIrkRfhZVdepLNK3ZsH/bib4xGVtfdBsLSO6n2trhK+kp6t1p+BRAWhNHseL5mGEUz+79MNuxGD/nIhuOO9/uHEZbvG09tl7eR0dKMCRumfDaD1tku6UPZ5cMhu0ZJTo62DhJ7UCksEWeczeb3K81b6114ELWkAvzxgIO3XtPECABM1sXtbINkn/Gk1+PQaROZMQg7Unsiyvy48b/wlsGCjTKNykNe30yH00dTKP3FzoQ8t/GhBU7F4tKvzrLedOISysblgemcssmtUtqcEJO6HbKaq6hWCoHmABErPdnnMWQyvVHE95gTz8jZDbYLEcJfG2cEtBXJ4Rmfc/4Bb30Yuze3XameeLf0EnCqtI0evBg7ga0H/hH0TwhHa8eHPo7fDKt8mhFoi2EMfSbzxozZzFzuXP76FvZAPXASlfewfX1LX9t9N1UTwgpu8PF7weYr19O1rEt82Ls9AKUaxAZjuGibJzMOzZXOpwTiWcYbM/qzenSn43RHTCgKY3pg/x2o2ZGLlynhtQfEUFynlB0fcodeffaD+/yWcw1g22QcCT3sXw0cQQcuzXWuKhsUQYBUPVWpG/zkqMO+oZT6G9p2Pee1cfl/fGz+Cb9eAS7XsgCcGcbgcfgNRVAZEvUGX6lZaiLgFFLn4cYFNpDzxh6E3jG5/yxO1vi3PT6KHIF+lrDSv14scGNIyYg1g4FG8/xwypl06FBBZaolOwA7JZqzV3EfqIvWn4rdJABw9S/qaDuX5jR5VoJBfHJkvzkMWSaHQEww9weSnh7bn+ t2UMeCon tBiD5QeiL/aOLkzzmU6PMpOtATdwwxSCRF42i6nbBh434FvchMMKdtJboh5henX6c9RPZmTKYEvcDts7FG/kDsqIi8MPKHR3WdRj/WCjCIXv0K8Pzihcxy+SHf79uGIO/zkyQIlJH3u+tWYcZtrkcGieV5whKuu9YoZaul+Xjhz/VH2VzRC778ZWsHoP6MYUyqOdU6/xguWee57gasKBS2Ub4GyOg5sfGWygok8wFk993fI2NWISRDHsY1GvhfHxwyqs7m50k7KLUBfqLBvXaXBlmZI6ReU6+r7cuMdAjxcg8kbWw6XPWGy0bjl3dZiFA9e/ZdofyUEJilAONNyU0VmIUp+5WXrMOLGEYg5+AWFj1xzE+JilVyW2wzL3JdXIFCH4nvnTWDZrtt6gxL8Ml5iWSzysBnJ9E/2cFXDcp/irnJh3QKJtJp3pm4JPasn6DHzUI X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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?