From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jaegeuk Kim Subject: [PATCH 2/2] f2fs: skip checkpoint if there is no dirty segments Date: Mon, 10 Aug 2015 18:23:25 -0700 Message-ID: <1439256205-8906-2-git-send-email-jaegeuk@kernel.org> References: <1439256205-8906-1-git-send-email-jaegeuk@kernel.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: Jaegeuk Kim To: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net Return-path: In-Reply-To: <1439256205-8906-1-git-send-email-jaegeuk@kernel.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: linux-f2fs-devel-bounces@lists.sourceforge.net List-Id: linux-fsdevel.vger.kernel.org We should avoid wrong checkpoints when there is no dirty segments. Signed-off-by: Jaegeuk Kim --- fs/f2fs/gc.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/fs/f2fs/gc.c b/fs/f2fs/gc.c index fcb263a..c4ed116 100644 --- a/fs/f2fs/gc.c +++ b/fs/f2fs/gc.c @@ -809,13 +809,14 @@ gc_more: if (unlikely(f2fs_cp_error(sbi))) goto stop; + if (!__get_victim(sbi, &segno, gc_type)) + goto stop; + if (gc_type == BG_GC && has_not_enough_free_secs(sbi, nfree)) { gc_type = FG_GC; write_checkpoint(sbi, &cpc); } - if (!__get_victim(sbi, &segno, gc_type)) - goto stop; ret = 0; /* readahead multi ssa blocks those have contiguous address */ -- 2.1.1 ------------------------------------------------------------------------------