Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp3697585pxv; Mon, 26 Jul 2021 09:38:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwrpbUuaULjwnoEc/EhdfhtgzPu5VHzJ8mnmCMfVO+IgDZcHd1rNpt+/oX+Q4jE/GGmpTpB X-Received: by 2002:a17:906:9742:: with SMTP id o2mr17817680ejy.532.1627317507911; Mon, 26 Jul 2021 09:38:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627317507; cv=none; d=google.com; s=arc-20160816; b=M6wjNyzPE1WBCQrM+QXwPpv/4E4MGN/N1kUGYYnnpSDJg5xeQTGDI48MqpnCkS9ipn y9OgULrbe6V4PBlY/ufk8iSpJ+E3QQZOk5KIg9nB6TLJLt2vhXjvsVh0vMmNotSwGy+3 AbijIlLRdSwVW0YqbujP8/VUoU3aAv0c9zv06CKSo8Y5tUXW+w3OFM6DhfsGUjStQL/w UFPbGKkWNU3Jd3tZ8S5P20d68HxXvnTnuNzRs71LGlNIAqo3ZLGYM6Lbmw4xa7a32K0O pt+qfW93z21MxB3AZPClxME8al00xu4z7YFdgDCYaYf0ywrp0FWcLKWqL0a9CmIIaFoA i9vA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=qkXX1dTV5tryy1iz57pWTH8vxQh5h9WUoXGgmMaR/fU=; b=DCelQKkAr8IECgzsMAPMoMR5a63s0vCaxyf+xJOFEIcufVsvEqegMluzcXRTGTyR4s mZj/f7eK4rbsky/wngU4RqgOeARqLUVIGSjkBPZHbUBTOHVPxrCM/JIaU3oZsSEiNQFw ARdArkDfkN810d0RrXL8n1t96Si3lLwnPb0XFCILuK62044etm2SK9i2mX/zCUtQy5ls W1ZqwaFpPdBmw/xfoIXFmcCJxCSDaBAzSVbmQDeJweaSlquolj9OHNEz3tT79MEfdJ/R 5qYpPKTObTsPGfp/RGR9KNXT5n7Xgj/yewp2ILjiij6oC/n4c/leigHwx7MZJLBvDV+Q f5Lg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=utJLbSCk; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j18si357520ejb.393.2021.07.26.09.38.05; Mon, 26 Jul 2021 09:38:27 -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; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=utJLbSCk; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240119AbhGZPy7 (ORCPT + 99 others); Mon, 26 Jul 2021 11:54:59 -0400 Received: from mail.kernel.org ([198.145.29.99]:51044 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234726AbhGZPdz (ORCPT ); Mon, 26 Jul 2021 11:33:55 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 50D5F604AC; Mon, 26 Jul 2021 16:14:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1627316043; bh=tv3iEgitgc75A0bg23isqSqMFGNrby9uKXpFxgZ/wQ0=; h=From:To:Cc:Subject:Date:From; b=utJLbSCklriQ95YuJeTxtNPqCtLoCJ6D1KUkkDK2z45T4Sy/65l8Zl6aPQvwueHJd J2jKif7/gwuCrkXdZe2z4y1p+8FyQp/rYJRuy/ucaKIWgmiirjMwkQz3UgUm7xHmEC vFml30psnBaWCZ2xQpdxoIr3WCoB2vvHM4YDZZ3rPeELWygJxkdjWzOagbiclQzYd5 hWQVvLiZYePNVb/5qO5gEsCn0GTIbkPcDN93Srd+juawUkUSvmJ/suBYcKzviN4AdO E007aB+rODfQkt8mWpkUO7AbjDkYzi4N4OmkP38qo3NElg5brrFw9rrHmPx+3o3UlS SbwRVAsVvmBog== From: Jaegeuk Kim To: linux-kernel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net Cc: Jaegeuk Kim Subject: [PATCH] f2fs: do not submit NEW_ADDR to read node block Date: Mon, 26 Jul 2021 09:13:57 -0700 Message-Id: <20210726161357.105332-1-jaegeuk@kernel.org> X-Mailer: git-send-email 2.32.0.432.gabb21c7263-goog MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org After the below patch, give cp is errored, we drop dirty node pages. This can give NEW_ADDR to read node pages. Don't do WARN_ON() which gives generic/475 failure. Fixes: 28607bf3aa6f ("f2fs: drop dirty node pages when cp is in error status") Signed-off-by: Jaegeuk Kim --- fs/f2fs/node.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fs/f2fs/node.c b/fs/f2fs/node.c index c945a9730f3c..5840b82ce311 100644 --- a/fs/f2fs/node.c +++ b/fs/f2fs/node.c @@ -1330,7 +1330,8 @@ static int read_node_page(struct page *page, int op_flags) if (err) return err; - if (unlikely(ni.blk_addr == NULL_ADDR) || + /* NEW_ADDR can be seen, after cp_error drops some dirty node pages */ + if (unlikely(ni.blk_addr == NULL_ADDR || ni.blk_addr == NEW_ADDR) || is_sbi_flag_set(sbi, SBI_IS_SHUTDOWN)) { ClearPageUptodate(page); return -ENOENT; -- 2.32.0.432.gabb21c7263-goog