Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp4628426ybv; Wed, 26 Feb 2020 00:12:10 -0800 (PST) X-Google-Smtp-Source: APXvYqwk3BMv/bS7uLDIpuBcyEX/OEMznip3PKdoqORqlhXs+fnD1PCxXe+/6xWCvPbIf1cpdXPA X-Received: by 2002:aca:f0b:: with SMTP id 11mr2219784oip.34.1582704730402; Wed, 26 Feb 2020 00:12:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582704730; cv=none; d=google.com; s=arc-20160816; b=zzVc0Qj2LazFpw8N68XbDVdWib0/GdReMGszn0brfB1VBcHyvefc1vNgYSHGurb6fx bvdhweKCSmMFr1aSZAL1r4b3v+4WL0mghyp4dvaLpS57zOxyJ5O/3pO8HUJ/Lm8I6jIO wYX2I0JjVYCHPsP+tGxZnVjOWmoYLH2E6MhFL6BnODG7sfrzpMopyabCaZcI+Bn1lFDH 9AZB23nozefv3yWgTHRZW5ywQJFmLlKbtxOvSBoDyVnfLQtEkhDkjT7aRFnuvnFvgMv7 97Ky3sGila/Sgu/f0GBjPD8LGfZUafbvgOqqKR25O9ojsSiy55ISqD4asY5bscmoKV/y Zp2g== 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=0lKLH866VmZybPyWebjR/M7XCuMF4KXyd7UDdWlJgrE=; b=QNGjvZfYnMyKspZM2Hn9ceUKgTsUzHNe2hgGJriHsCfTJeEZGxZ9fDk4YsnnPSUWob kiQBzO8W+F39DA0Yb1Y921x2WCmg1mdamEG6BLRruVnNh997sg/ByEWIpBziM0PgM1BD kieVRY0ti1JhpzhjAQQZPDtGGOguyZdHNkply/adR4ZWXgRKnTzJOaZZpxjKDJ+sud91 hgXGptYTxwUeTbpyHju+ukGyG8EQ6SsUUvpApC1bk6BOXUVk7qUkC3Fe1QSvbu1LUbPc klyaAIjQVt1I7fFxkKcnaMlIjOep+Y0rGpwl5G43a8vWcienPqZ3blvGXwz8f69lqmm8 k35g== 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 y6si738364oih.217.2020.02.26.00.11.58; Wed, 26 Feb 2020 00:12:10 -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 S1727470AbgBZILp (ORCPT + 99 others); Wed, 26 Feb 2020 03:11:45 -0500 Received: from szxga06-in.huawei.com ([45.249.212.32]:58022 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727341AbgBZILp (ORCPT ); Wed, 26 Feb 2020 03:11:45 -0500 Received: from DGGEMS404-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id 63636B788565C2E2F043; Wed, 26 Feb 2020 16:11:41 +0800 (CST) Received: from architecture4.huawei.com (10.160.196.180) by smtp.huawei.com (10.3.19.204) with Microsoft SMTP Server (TLS) id 14.3.439.0; Wed, 26 Feb 2020 16:11:35 +0800 From: Gao Xiang To: Chao Yu , CC: LKML , Miao Xie , "Gao Xiang" , Subject: [PATCH v2 1/3] erofs: correct the remaining shrink objects Date: Wed, 26 Feb 2020 16:10:06 +0800 Message-ID: <20200226081008.86348-1-gaoxiang25@huawei.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.160.196.180] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The remaining count should not include successful shrink attempts. Fixes: e7e9a307be9d ("staging: erofs: introduce workstation for decompression") Cc: # 4.19+ Signed-off-by: Gao Xiang --- Changes since v1: - Add "Fixes:" tags respectively suggested by Eric. I'd suggest no rush to backport PATCH 2/3 and 3/3 since it's not quite sure whether they behave well for normal images for now and I will backport them manually later since they have no impact on system stability with corrupted images; - Fix PATCH 2/3 to exclude legacy (no decompression inplace support, < v5.3) images. fs/erofs/utils.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/erofs/utils.c b/fs/erofs/utils.c index fddc5059c930..df42ea552a44 100644 --- a/fs/erofs/utils.c +++ b/fs/erofs/utils.c @@ -286,7 +286,7 @@ static unsigned long erofs_shrink_scan(struct shrinker *shrink, spin_unlock(&erofs_sb_list_lock); sbi->shrinker_run_no = run_no; - freed += erofs_shrink_workstation(sbi, nr); + freed += erofs_shrink_workstation(sbi, nr - freed); spin_lock(&erofs_sb_list_lock); /* Get the next list element before we move this one */ -- 2.17.1