From patchwork Thu Sep 22 03:54:57 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jaegeuk Kim X-Patchwork-Id: 9344455 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 2BF1B6077A for ; Thu, 22 Sep 2016 03:56:24 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1CC4F2A3CC for ; Thu, 22 Sep 2016 03:56:24 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1188C2A3D4; Thu, 22 Sep 2016 03:56:24 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B51E82A3CC for ; Thu, 22 Sep 2016 03:56:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934372AbcIVD4H (ORCPT ); Wed, 21 Sep 2016 23:56:07 -0400 Received: from mail.kernel.org ([198.145.29.136]:55434 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934439AbcIVDzp (ORCPT ); Wed, 21 Sep 2016 23:55:45 -0400 Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 9BA82203F3; Thu, 22 Sep 2016 03:55:43 +0000 (UTC) Received: from localhost (107-1-141-74-ip-static.hfc.comcastbusiness.net [107.1.141.74]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id A3406203F4; Thu, 22 Sep 2016 03:55:42 +0000 (UTC) From: Jaegeuk Kim To: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net Cc: Jaegeuk Kim Subject: [PATCH 3/4] f2fs: avoid gc in cp_error case Date: Wed, 21 Sep 2016 20:54:57 -0700 Message-Id: <20160922035458.5002-3-jaegeuk@kernel.org> X-Mailer: git-send-email 2.8.3 In-Reply-To: <20160922035458.5002-1-jaegeuk@kernel.org> References: <20160922035458.5002-1-jaegeuk@kernel.org> X-Virus-Scanned: ClamAV using ClamSMTP Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Otherwise, we can hit f2fs_bug_on(sbi, !PageUptodate(sum_page)); Signed-off-by: Jaegeuk Kim --- fs/f2fs/gc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fs/f2fs/gc.c b/fs/f2fs/gc.c index a9a3c9f..b9d6c42 100644 --- a/fs/f2fs/gc.c +++ b/fs/f2fs/gc.c @@ -847,7 +847,8 @@ static int do_garbage_collect(struct f2fs_sb_info *sbi, for (segno = start_segno; segno < end_segno; segno++) { - if (get_valid_blocks(sbi, segno, 1) == 0) + if (get_valid_blocks(sbi, segno, 1) == 0 || + unlikely(f2fs_cp_error(sbi))) goto next; /* find segment summary of victim */