Received: by 10.213.65.68 with SMTP id h4csp1716460imn; Mon, 19 Mar 2018 11:17:16 -0700 (PDT) X-Google-Smtp-Source: AG47ELvOMITsVEjQip1apHbIfbj7ZnHF4PekQravSOGOrC6jBSbjlXYymNdLzihzWXeExdTj2ty8 X-Received: by 10.101.81.133 with SMTP id h5mr3843070pgq.83.1521483436330; Mon, 19 Mar 2018 11:17:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521483436; cv=none; d=google.com; s=arc-20160816; b=nZ7borerfbxKYO8jYArwXYhkyBWDYYeiQwfMwgOY+3htFVIlkwkP/4m822CqlcyGXw Xrt2srkSz7CZHdfnL10VtbxkD5JZfxClhVcmySD7xijRY0e/8XpwWu99FFkwN8jBZ5bN ef00B3x9pQp2+5RW2XPmM4ThjJnRWAMPVI9Dv7yM3KuzTeyNJ6OsWET3UJRiBXfJ87gl 7uvVmx2JDeFDqlqAE55DUksey598VdRAAdT+pe59tyfWoFzwB2xJpFky3uUSvVTE9Qbq BafcCY/U5s3yIliFUVG2DZsylpZEboqQpvSiC1ZZPLnHF10STkdfN9KmG8LocWSrS3rh yWwg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=TKVyeHAURhW4yUSIHQCMUTM/yyfhOW94CZKUVdGhL4c=; b=q61JtQEc6pmzYks06/QpyTK2ZzE/6EDlgvvOVNIrLT1TAIBGYZp4AiRG197OfHhOLt EDcVQkpjqev8QMeDKq4UmSncijQFsPcD/qjWhUxxIMmmfEnvUncsjMyMEiYTaNB32Mj9 S5fdwPQFw81IiDS3ZiqC+1x4oQs6YI06na+mkQhlvuHxv7P6eEK7hNUwI2QGZBC563s4 /QN+HAU7L/ZKJa1gtpZcIS5PA+BQw7oDZys0UjR+6Mz0G8BgEOEQ/9q+xsEdzikuHrPZ 7uaY0uoy18r0foPWYHz4OTQJzC2CQEvo5wqBPjX38XklKPsbhg3KNP6p0rDsM9nDiEh8 zLrg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m70si308378pfk.344.2018.03.19.11.17.01; Mon, 19 Mar 2018 11:17:16 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1030737AbeCSSPE (ORCPT + 99 others); Mon, 19 Mar 2018 14:15:04 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:44420 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1030722AbeCSSO6 (ORCPT ); Mon, 19 Mar 2018 14:14:58 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 21FDEF37; Mon, 19 Mar 2018 18:14:57 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Yunlei He , Jaegeuk Kim , Sasha Levin Subject: [PATCH 4.4 039/134] f2fs: relax node version check for victim data in gc Date: Mon, 19 Mar 2018 19:05:22 +0100 Message-Id: <20180319171854.987259946@linuxfoundation.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180319171849.024066323@linuxfoundation.org> References: <20180319171849.024066323@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.4-stable review patch. If anyone has any objections, please let me know. ------------------ From: Jaegeuk Kim [ Upstream commit c13ff37e359bb3eacf4e1760dcea8d9760aa7459 ] - has_not_enough_free_secs node_secs: 0 dent_secs: 0 freed:0 free_segments:103 reserved:104 - f2fs_gc - get_victim_by_default alloc_mode 0, gc_mode 1, max_search 2672, offset 4654, ofs_unit 1 - do_garbage_collect start_segno 3976, end_segno 3977 type 0 - is_alive nid 22797, blkaddr 2131882, ofs_in_node 0, version 0x8/0x0 - gc_data_segment 766, segno 3976, block 512/426 not alive So, this patch fixes subtle corrupted case where node version does not match to summary version which results in infinite loop by gc. Reported-by: Yunlei He Signed-off-by: Jaegeuk Kim Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- fs/f2fs/gc.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) --- a/fs/f2fs/gc.c +++ b/fs/f2fs/gc.c @@ -522,8 +522,10 @@ static bool is_alive(struct f2fs_sb_info get_node_info(sbi, nid, dni); if (sum->version != dni->version) { - f2fs_put_page(node_page, 1); - return false; + f2fs_msg(sbi->sb, KERN_WARNING, + "%s: valid data with mismatched node version.", + __func__); + set_sbi_flag(sbi, SBI_NEED_FSCK); } *nofs = ofs_of_node(node_page);