Received: by 2002:ac0:aa62:0:0:0:0:0 with SMTP id w31-v6csp681850ima; Wed, 24 Oct 2018 07:38:59 -0700 (PDT) X-Google-Smtp-Source: AJdET5fWxNKxafHfa80vXYdOtRrBsNQbiZQOMj+ue+xuJhZ6YG5r6y4zjomEB6dWVJB2R9hSyJ+d X-Received: by 2002:a62:418a:: with SMTP id g10-v6mr452314pfd.44.1540391939653; Wed, 24 Oct 2018 07:38:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540391939; cv=none; d=google.com; s=arc-20160816; b=uTBYV6AErqfE9vqjz4Ev8yW9SRVjj6Q7OtDz4r+LYPPewGKIsgnP9AYd4Xo9UD5awC Nodb1uC/RZ/OYeHlP6ib+O8ptgNz881rNE4aIBXKuHDpLXjeVWvdHFjgK9BM/ntl97oj 7kYlmxEFTaxwOOwBBBPGmoK48BHreUyq6AgF0Aur7iv3Uyi8cEUoWCfKj0DRlXp+8bAF zElS4O2v4khZ5tNwwluiRcBoeO4FPIddEdyyUldfCfWtgtnkbjyb4czOtMwcWGvAcpx3 EEzz6qpMQcf6qwjB9iXTgdmwO+/Ar8eP2FikUwH7kvaME4QcFyv3X6wHu7rTQn+Xoon0 KQbg== 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; bh=Y+NRJSlIMrrBod2qFY8LHpGaxBXy/+yTKRPp8SMcXkM=; b=YyiuNXKJQKJlHmh2IiUgzKfup9XZgmRrdjWKHZrlcuZazLltifh0gr8xirx9cZpGSd Fe46zqfM3AEyoeMs2KY8PYA+Q8sxiY2EuQti9yJD5p3q1NbTM96s0FpNLS5cngedzqVQ jYRtGukgiYxmM1wtiwE7rGnigWzTU2KjUtexNy/BweHfTeH5dWfogC4vVutnwDUX5Qfk xsEFuD9e7oWv4dCpPyV1BKW+gfd/b+peXv7CgRDFTvuPDf3TirkUi7cDnXl1ndAJASyA tdHGb1+Q5aoYdpogy1FfNT11bDjU8iCkZpJax+35T0Du0cM706KThLy1I/khviQFyLjL +QCA== 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 s17-v6si4712165pgm.317.2018.10.24.07.38.43; Wed, 24 Oct 2018 07:38:59 -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 S1726919AbeJXXEj (ORCPT + 99 others); Wed, 24 Oct 2018 19:04:39 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:13689 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726423AbeJXXEj (ORCPT ); Wed, 24 Oct 2018 19:04:39 -0400 Received: from DGGEMS409-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id C871FBB53ABC6; Wed, 24 Oct 2018 22:36:09 +0800 (CST) Received: from huawei.com (10.113.189.234) by DGGEMS409-HUB.china.huawei.com (10.3.19.209) with Microsoft SMTP Server id 14.3.408.0; Wed, 24 Oct 2018 22:36:00 +0800 From: Yunlong Song To: , , , , CC: , , , , , Subject: [PATCH] f2fs: change segment to section in f2fs_ioc_gc_range Date: Wed, 24 Oct 2018 22:35:36 +0800 Message-ID: <1540391736-20714-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.113.189.234] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org f2fs_ioc_gc_range skips blocks_per_seg each time, however, f2fs_gc moves blocks of section each time, so fix it from segment to section. Signed-off-by: Yunlong Song --- fs/f2fs/file.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c index 88b1246..8c06724 100644 --- a/fs/f2fs/file.c +++ b/fs/f2fs/file.c @@ -2155,7 +2155,7 @@ static int f2fs_ioc_gc_range(struct file *filp, unsigned long arg) } ret = f2fs_gc(sbi, range.sync, true, GET_SEGNO(sbi, range.start)); - range.start += sbi->blocks_per_seg; + range.start += sbi->blocks_per_seg * sbi->segs_per_sec; if (range.start <= end) goto do_more; out: -- 1.8.5.2