Received: by 10.223.164.202 with SMTP id h10csp1032209wrb; Tue, 7 Nov 2017 20:14:37 -0800 (PST) X-Google-Smtp-Source: ABhQp+Ref39SACY+ui0spOHKqPDVF9QV5ZB9GZrVGUlA/nWHnQL0iy9n2cJejuspvAj+dGvJnbiW X-Received: by 10.99.63.199 with SMTP id m190mr972333pga.187.1510114476991; Tue, 07 Nov 2017 20:14:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510114476; cv=none; d=google.com; s=arc-20160816; b=QtgOzKY+4H0RdyztNCCm6MrqU6fM0rNjMUoZqdX50XaLRzhEime9iEEhcCBUlRjgDa G9G+EJO6GGOiz3PwxiU4ff86xyTni748DMECtSScos0oQLBIaDa7yEYAV5CDiBI5Sry3 O4A+P66ldkiyWnE3tQkeRs9FeeXi5xsUijWYh/ZoypJ6vHkx7R/M9EJ4LnMsMSvI/DZy G5/bnfw7VR6nPGLlU9BWMa3tmmkCc55E19r+gZuzDBs3eUa2+j47xMcc4KAi2aXidMDS GT0yf8LgyTmEwdlGw5GlyBFtKn2rExZEcesLrwINTeYmK+xhltym0sFxScNRk4VP+g/z glPg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:cc :to:from:arc-authentication-results; bh=zab+nEX5xeuZDEnI/yIVNkkuSOJ2LFjXmeztSKlFTgU=; b=U36UIWjT4+Wgh+vsWG3d/A1fESe7H7fcF7KofnNtnxpbqU9VU8sQz49+4jB1ecfoFW nuyxqMv0vm3QTeDm/rxmg9HPbPB9IsnBoIPHcTAFUZjqmDcnXBTzI+g/xrRHDyi/STVP 0YcsOLqrAx2128pjsZ3j+Dd3Vpke1GOCX3hSaPN6Fae1q9NPY3f57hpGq9Hy0WsdIxyd tAshnbL9cNXVC3cRCwlJV15GkRTY8A2zOhhKfS2alrK/3HqkmocN6mP9pL8IsX8ZfuF2 6DAgFPtl5AhuhmKsiCvBL55PojppzdOY7uFCJQfcbppVewErzkIpJ+FCJjFOLe7W/qK3 sxOg== 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 a25si2742191pff.55.2017.11.07.20.14.23; Tue, 07 Nov 2017 20:14:36 -0800 (PST) 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 S1751961AbdKHCfQ (ORCPT + 90 others); Tue, 7 Nov 2017 21:35:16 -0500 Received: from szxga04-in.huawei.com ([45.249.212.190]:9974 "EHLO szxga04-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750778AbdKHCfP (ORCPT ); Tue, 7 Nov 2017 21:35:15 -0500 Received: from 172.30.72.59 (EHLO DGGEMS412-HUB.china.huawei.com) ([172.30.72.59]) by dggrg04-dlp.huawei.com (MOS 4.4.6-GA FastPath queued) with ESMTP id DKK70805; Wed, 08 Nov 2017 10:35:12 +0800 (CST) Received: from huawei.com (10.107.193.250) by DGGEMS412-HUB.china.huawei.com (10.3.19.212) with Microsoft SMTP Server id 14.3.361.1; Wed, 8 Nov 2017 10:35:04 +0800 From: Yunlong Song To: , , , , CC: , , , , Subject: [PATCH] f2fs: let f2fs also gc atomic file to avoid loop gc Date: Wed, 8 Nov 2017 10:34:57 +0800 Message-ID: <1510108497-58331-1-git-send-email-yunlong.song@huawei.com> X-Mailer: git-send-email 1.8.5.2 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.107.193.250] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A020202.5A026D60.00A8,ss=1,re=0.000,recu=0.000,reip=0.000,cl=1,cld=1,fgs=0, ip=0.0.0.0, so=2014-11-16 11:51:01, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: 9cc7d38082be0ab43e4fd29a7053c40e Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org If some files are opened with atomic flag and have not commited yet, at the same time, if all the target victim segments have at least one page of these atomic files, then f2fs gc will fail to do gc and hangs in the process of go to gc_more, since gc_date_segment will not move any data and get_valid_blocks will never be 0, then do_garbage_collect will always return 0. Signed-off-by: Yunlong Song --- fs/f2fs/gc.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/fs/f2fs/gc.c b/fs/f2fs/gc.c index 5d5bba4..3fdcd04 100644 --- a/fs/f2fs/gc.c +++ b/fs/f2fs/gc.c @@ -621,9 +621,6 @@ static void move_data_block(struct inode *inode, block_t bidx, if (!check_valid_map(F2FS_I_SB(inode), segno, off)) goto out; - if (f2fs_is_atomic_file(inode)) - goto out; - set_new_dnode(&dn, inode, NULL, NULL, 0); err = get_dnode_of_data(&dn, bidx, LOOKUP_NODE); if (err) @@ -718,9 +715,6 @@ static void move_data_page(struct inode *inode, block_t bidx, int gc_type, if (!check_valid_map(F2FS_I_SB(inode), segno, off)) goto out; - if (f2fs_is_atomic_file(inode)) - goto out; - if (gc_type == BG_GC) { if (PageWriteback(page)) goto out; -- 1.8.5.2 From 1584666463062317873@xxx Tue Nov 21 09:15:05 +0000 2017 X-GM-THRID: 1584345745054932060 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread