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 76E5DC38142 for ; Mon, 23 Jan 2023 15:50:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232931AbjAWPue (ORCPT ); Mon, 23 Jan 2023 10:50:34 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56186 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232579AbjAWPud (ORCPT ); Mon, 23 Jan 2023 10:50:33 -0500 Received: from smtp-out2.suse.de (smtp-out2.suse.de [IPv6:2001:67c:2178:6::1d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 827DC193FD; Mon, 23 Jan 2023 07:50:30 -0800 (PST) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 2FA6A1F749; Mon, 23 Jan 2023 15:50:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1674489029; h=from:from:reply-to:reply-to: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=sUGIH2I54cp4HbnMiIaY15PfXULieuiQ0sW9X9yG6Sc=; b=OPXFoGuJ8BkSymKabi8S/f/rmJEkvx+fgrXVqizmYyDI3KhBbMlUuLj8YQectO2Ngl9/Sf oGaVWENU63tAhnkYzTuPgH+u6QSbPi1G42bWVBQW/Fd77EpB2+8rwpOtlrkGfwdjkyAjny CVCmqcffKPgt8etMatoZ+dSqDZHYXIU= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1674489029; h=from:from:reply-to:reply-to: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=sUGIH2I54cp4HbnMiIaY15PfXULieuiQ0sW9X9yG6Sc=; b=xOcYsz+zrkERuCg65RzTgYDWspE7gLGRBq0M143VodPXwP6GO0FzliKs6WdMBcPvTtIt12 vGjp9a9wvCEfUZBg== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id D1B05134F5; Mon, 23 Jan 2023 15:50:28 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id euY6MsSszmOdYgAAMHmgww (envelope-from ); Mon, 23 Jan 2023 15:50:28 +0000 Date: Mon, 23 Jan 2023 16:44:47 +0100 From: David Sterba To: Christoph Hellwig Cc: Andrew Morton , 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: [PATCH 7/7] mm: return an ERR_PTR from __filemap_get_folio Message-ID: <20230123154447.GP11562@twin.jikos.cz> Reply-To: dsterba@suse.cz References: <20230121065755.1140136-1-hch@lst.de> <20230121065755.1140136-8-hch@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230121065755.1140136-8-hch@lst.de> User-Agent: Mutt/1.5.23.1-rc1 (2014-03-12) Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Sat, Jan 21, 2023 at 07:57:55AM +0100, Christoph Hellwig wrote: > Instead of returning NULL for all errors, distinguish between: > > - no entry found and not asked to allocated (-ENOENT) > - failed to allocate memory (-ENOMEM) > - would block (-EAGAIN) > > so that callers don't have to guess the error based on the passed > in flags. > > Also pass through the error through the direct callers: > filemap_get_folio, filemap_lock_folio filemap_grab_folio > and filemap_get_incore_folio. > > Signed-off-by: Christoph Hellwig > --- > fs/afs/dir.c | 10 +++++----- > fs/afs/dir_edit.c | 2 +- > fs/afs/write.c | 4 ++-- For > fs/btrfs/disk-io.c | 2 +- Acked-by: David Sterba