Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp231147ybt; Tue, 30 Jun 2020 19:28:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzQhBOPgtppp9kyWDHlllekF2rwyCYRJOgBaa8HnMSXjy9FyIVFGcfAHz9+8PXBwgfmD7SI X-Received: by 2002:a50:eb02:: with SMTP id y2mr23911819edp.281.1593570490923; Tue, 30 Jun 2020 19:28:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593570490; cv=none; d=google.com; s=arc-20160816; b=uRxrQdin9F585McetJi/PDve0KNWmrF1+q2WmNfujWNMlrvNEGmwYbBaAAIPaNkVLp c2zKheoAhiQGzWJV9HZxpSn3al1WfC3qQgX9sWjqLorwXa5IdaOdYYF9LzKCgl0+WkGk ufB56Nuq0wLf5hM4Qas+M+/YVrnYE26Pxkg+rm84UneeFkBb6wqm1S1XfT17YN0gxsBl fGJ3YjyLKr2KHkQkvgfzG2FRgpg6szPjWeEO3GWHqmtcIsTSruU//ngw+LM5dGlkLdH2 dN7Gw3M2iVbkJbpZVf5AKvrZcuB8qJtUmBlJepbo9cHfHFk9MyVTfTqEeylzcRbpur/+ lHaQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=PCMJ890IaowWrTpU3HaHY9CDnBZwqkRf24NtevV1Y48=; b=oZLPNHIujRY2UoO03g2TJcc+nx7HPCuF3hkKm9gNUd5aeOufzZQVUG17d3N4VgLX/d jhId4PlBzgrsB/tISvsL4Ongcv+XpenyckNBkcobTulczAr+q1hxFMp+czgMnobqQCUr ov2h14UtcJ0HiEAE8VYg4Pa99K9PbftG34/g3xaGo2OcCV/FDqdoKA5vW516jhIrpz1X 98YbXg9ZbZ0t0Q/wmIedTYBModX+Rd3q5Pq7ASGKELrE8PUY8NZJeHc6zej8yF3c/zCJ 9T74+hgfIK9Iwa4j/GFC8OTQq91W9hhf1cg8uDLTNsg6Rz1WL5vtQ/YcO3KZh/tuMPk5 aasw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k25si2878182ejv.672.2020.06.30.19.27.48; Tue, 30 Jun 2020 19:28:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726810AbgGAC1W (ORCPT + 99 others); Tue, 30 Jun 2020 22:27:22 -0400 Received: from szxga07-in.huawei.com ([45.249.212.35]:58490 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725988AbgGAC1W (ORCPT ); Tue, 30 Jun 2020 22:27:22 -0400 Received: from DGGEMS412-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id 61960232CF64741355D5; Wed, 1 Jul 2020 10:27:19 +0800 (CST) Received: from szvp000203569.huawei.com (10.120.216.130) by DGGEMS412-HUB.china.huawei.com (10.3.19.212) with Microsoft SMTP Server id 14.3.487.0; Wed, 1 Jul 2020 10:27:12 +0800 From: Chao Yu To: CC: , , , Chao Yu Subject: [PATCH] f2fs: fix return value of move_data_block() Date: Wed, 1 Jul 2020 10:27:09 +0800 Message-ID: <20200701022709.128466-1-yuchao0@huawei.com> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.120.216.130] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org If f2fs_grab_cache_page() fails, it needs to return -ENOMEM. Signed-off-by: Chao Yu --- fs/f2fs/gc.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/fs/f2fs/gc.c b/fs/f2fs/gc.c index 3b718da69910..11b4adde9baf 100644 --- a/fs/f2fs/gc.c +++ b/fs/f2fs/gc.c @@ -849,8 +849,10 @@ static int move_data_block(struct inode *inode, block_t bidx, mpage = f2fs_grab_cache_page(META_MAPPING(fio.sbi), fio.old_blkaddr, false); - if (!mpage) + if (!mpage) { + err = -ENOMEM; goto up_out; + } fio.encrypted_page = mpage; -- 2.26.2