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 X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1CB14C2D0C2 for ; Tue, 31 Dec 2019 18:15:32 +0000 (UTC) Received: from lists.sourceforge.net (lists.sourceforge.net [216.105.38.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id EBE41206E0; Tue, 31 Dec 2019 18:15:31 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=sourceforge.net header.i=@sourceforge.net header.b="Gc/XJZQV"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=sf.net header.i=@sf.net header.b="efDNg2Ce"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="VvBZ6DKL" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org EBE41206E0 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=linux-f2fs-devel-bounces@lists.sourceforge.net Received: from [127.0.0.1] (helo=sfs-ml-4.v29.lw.sourceforge.com) by sfs-ml-4.v29.lw.sourceforge.com with esmtp (Exim 4.90_1) (envelope-from ) id 1imM3H-0007nP-9Y; Tue, 31 Dec 2019 18:15:31 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-4.v29.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.90_1) (envelope-from ) id 1imM3F-0007nF-1P for linux-f2fs-devel@lists.sourceforge.net; Tue, 31 Dec 2019 18:15:29 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=Content-Transfer-Encoding:MIME-Version:Message-Id: Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=CpJvdkoFOG8u6urxBV+FeTUD+acFwyhD9uYxs9gUu8M=; b=Gc/XJZQVR8toASYADbTFBcSNiC KDj6uaTpNzUflZ/eYfY4gKh0D6o1hNzaF2Fd+aNkpdsvO1Ixy1vEZqtmrJsTSu0Pdk1riLt+V/Rrr YXi7Elg9hMnkH+ceuOQI5xh0DAsE8Q2/NTF0wlz1+vyiLU269JxMzQqrkhuV+VFcrGGo=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=Content-Transfer-Encoding:MIME-Version:Message-Id:Date:Subject:Cc:To:From :Sender:Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Id:List-Help:List-Unsubscribe:List-Subscribe:List-Post: List-Owner:List-Archive; bh=CpJvdkoFOG8u6urxBV+FeTUD+acFwyhD9uYxs9gUu8M=; b=e fDNg2Ce/72b5cf6u+Fp8UxhNaYeeZP3e2PKVuW3gCwEdhHyLLoOC3tcpvvzzY3RVj6UqgJLcsMEl2 L76HzoJU2Pwg6XXevSKtpzCCBYyqWpzqN5iApoMVoqxPz/uKLeGXFgO0dUDnCTxHa9iJdsT4OHLQN dkc1zlUsmYKK6dXc=; Received: from mail.kernel.org ([198.145.29.99]) by sfi-mx-3.v28.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92.2) id 1imM38-004GMJ-PI for linux-f2fs-devel@lists.sourceforge.net; Tue, 31 Dec 2019 18:15:27 +0000 Received: from zzz.tds (h75-100-12-111.burkwi.broadband.dynamic.tds.net [75.100.12.111]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id E9F58206E0; Tue, 31 Dec 2019 18:15:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1577816117; bh=R7F0k84TKiRuXBbh08JjpWu+dILQdgBWUuwJnRPVITs=; h=From:To:Cc:Subject:Date:From; b=VvBZ6DKLJT67FOwaf2TjKTfeJkQtxdwc1JKZLSGwK7uxvTFC0Yen37Bm4uySTPGit 8Iq+XBuHVNxJN9Z0/rGmLuz31TE7TdPcRtlOrOYjFeoZuect9/f2tFsFXhla5wgpv4 +NKXpZwcV8tBvHd2cqOsJWT9qDan88gnaAgejH8Q= From: Eric Biggers To: linux-f2fs-devel@lists.sourceforge.net Date: Tue, 31 Dec 2019 12:14:56 -0600 Message-Id: <20191231181456.47957-1-ebiggers@kernel.org> X-Mailer: git-send-email 2.24.1 MIME-Version: 1.0 X-Headers-End: 1imM38-004GMJ-PI Subject: [f2fs-dev] [PATCH] f2fs: remove unneeded check for error allocating bio_post_read_ctx X-BeenThere: linux-f2fs-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-fscrypt@vger.kernel.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: linux-f2fs-devel-bounces@lists.sourceforge.net From: Eric Biggers Since allocating an object from a mempool never fails when __GFP_DIRECT_RECLAIM (which is included in GFP_NOFS) is set, the check for failure to allocate a bio_post_read_ctx is unnecessary. Remove it. Signed-off-by: Eric Biggers --- fs/f2fs/data.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c index 618a05bf356e..b52e1512f82e 100644 --- a/fs/f2fs/data.c +++ b/fs/f2fs/data.c @@ -939,11 +939,8 @@ static struct bio *f2fs_grab_read_bio(struct inode *inode, block_t blkaddr, post_read_steps |= 1 << STEP_VERITY; if (post_read_steps) { + /* Due to the mempool, this never fails. */ ctx = mempool_alloc(bio_post_read_ctx_pool, GFP_NOFS); - if (!ctx) { - bio_put(bio); - return ERR_PTR(-ENOMEM); - } ctx->bio = bio; ctx->sbi = sbi; ctx->enabled_steps = post_read_steps; -- 2.24.1 _______________________________________________ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel 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 X-Spam-Level: X-Spam-Status: No, score=-10.1 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 39876C2D0C2 for ; Tue, 31 Dec 2019 18:15:18 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 0CDBD206E4 for ; Tue, 31 Dec 2019 18:15:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1577816118; bh=R7F0k84TKiRuXBbh08JjpWu+dILQdgBWUuwJnRPVITs=; h=From:To:Cc:Subject:Date:List-ID:From; b=bc1gaFvyhA/CMzX+kBo1ISDsHyAKysJgUAd5CcqqLlr7gAc0JMW1c/C9jaYDECSd2 x8DRQahihgSD3ui4EsPncIZ9b8asDZLxioH9Kz5REqVyI5PTaiZgkGo0PmQOR0ZvMv L0YoRyzliDVDC9RQ95fEZmEy3GH9NTjTJLWWr7xY= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727079AbfLaSPR (ORCPT ); Tue, 31 Dec 2019 13:15:17 -0500 Received: from mail.kernel.org ([198.145.29.99]:52152 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726720AbfLaSPR (ORCPT ); Tue, 31 Dec 2019 13:15:17 -0500 Received: from zzz.tds (h75-100-12-111.burkwi.broadband.dynamic.tds.net [75.100.12.111]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id E9F58206E0; Tue, 31 Dec 2019 18:15:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1577816117; bh=R7F0k84TKiRuXBbh08JjpWu+dILQdgBWUuwJnRPVITs=; h=From:To:Cc:Subject:Date:From; b=VvBZ6DKLJT67FOwaf2TjKTfeJkQtxdwc1JKZLSGwK7uxvTFC0Yen37Bm4uySTPGit 8Iq+XBuHVNxJN9Z0/rGmLuz31TE7TdPcRtlOrOYjFeoZuect9/f2tFsFXhla5wgpv4 +NKXpZwcV8tBvHd2cqOsJWT9qDan88gnaAgejH8Q= From: Eric Biggers To: linux-f2fs-devel@lists.sourceforge.net Cc: linux-fscrypt@vger.kernel.org Subject: [PATCH] f2fs: remove unneeded check for error allocating bio_post_read_ctx Date: Tue, 31 Dec 2019 12:14:56 -0600 Message-Id: <20191231181456.47957-1-ebiggers@kernel.org> X-Mailer: git-send-email 2.24.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-fscrypt-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fscrypt@vger.kernel.org From: Eric Biggers Since allocating an object from a mempool never fails when __GFP_DIRECT_RECLAIM (which is included in GFP_NOFS) is set, the check for failure to allocate a bio_post_read_ctx is unnecessary. Remove it. Signed-off-by: Eric Biggers --- fs/f2fs/data.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c index 618a05bf356e..b52e1512f82e 100644 --- a/fs/f2fs/data.c +++ b/fs/f2fs/data.c @@ -939,11 +939,8 @@ static struct bio *f2fs_grab_read_bio(struct inode *inode, block_t blkaddr, post_read_steps |= 1 << STEP_VERITY; if (post_read_steps) { + /* Due to the mempool, this never fails. */ ctx = mempool_alloc(bio_post_read_ctx_pool, GFP_NOFS); - if (!ctx) { - bio_put(bio); - return ERR_PTR(-ENOMEM); - } ctx->bio = bio; ctx->sbi = sbi; ctx->enabled_steps = post_read_steps; -- 2.24.1