From patchwork Mon Oct 24 11:27:27 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 9047 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp442377wru; Mon, 24 Oct 2022 06:07:25 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5kRURVpmgiM+91hHaG35NHvwSy2c2SrC4h3dG9MuCpcxX5RAOl4vjVr/uIwr/+mA68ZW5y X-Received: by 2002:a17:90b:4a90:b0:20d:5c5e:1622 with SMTP id lp16-20020a17090b4a9000b0020d5c5e1622mr74966863pjb.50.1666616844871; Mon, 24 Oct 2022 06:07:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666616844; cv=none; d=google.com; s=arc-20160816; b=pnPsFdPeoSGMZSnXpIdYtJPybxwh154CJnFAQxvWDqY3qCkx/6LMIF5KKTYoNTWcn9 OFYEclp7cx24GGzoN6WZkDYvd+DX1xaUbX6JWK5VrxIhbj/+/eymIcL+tTBNchTcRdMW pAWR/KEZFjwGknTpHrZFNSw7Qt6Q7PAEpxIGb2D600CaCO/5emXw7CfppViXg2hHGbIA PPJ2XtX6dbPTqk0Zg7E1qIXTr7rgMb5GIXbdB4QPCrt64TDsJ0YFvWi6IJXTNf3RMTqV Uv6UTR7Xgg79VuGjmpgtenqVkXWc9jUjxkAf6tDa4q2lASGcr5vw2h2PtRrpzWyIqBQ6 KXaQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=PApGhNdxYJN43T2HWwPE5wK5hWD9pHFLwjBNlQpw6LE=; b=ue+n70urm7li7uE8KEG8Qy9WShCZKhjAbE31X+JnW2rjhPT9uALTKDzYHQ+msYA4z0 8+csMtmOXLBoSBGV1n/jbMRT6v8Zt4FU6o10FLPbHNFyI2rQqWxhD8BNNVsEUnOF3EZC 75gjR/mcO+IvFgGhzb/zYbBMDb6LBK8mee91QYnsjqYO1ueb9rx+/pQCNwb6G28mzWNq TpJoLPxvX4rUo7SnYA4NObAswJBoVBhMP621ayOjnWx9BrHL1odBzkjI0iBMWlN3mvFb MiSShD2aIdW72U3Htnz4zjcH6NxVi0GZ8dexKVUaAgmi7NrtUdpRLMMzxCK/1+rvYL+a 2Zqg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=192WOMK6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u16-20020a62ed10000000b00562331a3562si30229512pfh.130.2022.10.24.06.06.38; Mon, 24 Oct 2022 06:07:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=192WOMK6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235338AbiJXNFh (ORCPT + 99 others); Mon, 24 Oct 2022 09:05:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34806 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235166AbiJXNC4 (ORCPT ); Mon, 24 Oct 2022 09:02:56 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0C29C3FA36; Mon, 24 Oct 2022 05:20:05 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 03E7F612CF; Mon, 24 Oct 2022 12:19:16 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 184C3C433D6; Mon, 24 Oct 2022 12:19:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666613955; bh=MQ4sZieayU4xazipjvklwUwGMXXkKmbKgFkPDFPU528=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=192WOMK6b8TKUJOkSXrRMyROdBUERiTmk69cX1y1yOdIo0JHlvS04vVr2QDq3ixq7 vU/g1zzbzT3X6OEOb5peK/IEWu400ZoXgbyJw/1xGB1RaKhstg75AizGQAXo2NrL3b pAOTi2a8NkkdYqbHMK2YB4MhqAmyVRtgnsYxbDpM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Aran Dalton , Chao Yu , Jaegeuk Kim Subject: [PATCH 5.10 050/390] f2fs: increase the limit for reserve_root Date: Mon, 24 Oct 2022 13:27:27 +0200 Message-Id: <20221024113024.763778817@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221024113022.510008560@linuxfoundation.org> References: <20221024113022.510008560@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 X-Spam-Status: No, score=-7.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747574425096798414?= X-GMAIL-MSGID: =?utf-8?q?1747574425096798414?= From: Jaegeuk Kim commit da35fe96d12d15779f3cb74929b7ed03941cf983 upstream. This patch increases the threshold that limits the reserved root space from 0.2% to 12.5% by using simple shift operation. Typically Android sets 128MB, but if the storage capacity is 32GB, 0.2% which is around 64MB becomes too small. Let's relax it. Cc: stable@vger.kernel.org Reported-by: Aran Dalton Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim Signed-off-by: Greg Kroah-Hartman --- fs/f2fs/super.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/fs/f2fs/super.c +++ b/fs/f2fs/super.c @@ -267,10 +267,10 @@ static int f2fs_sb_read_encoding(const s static inline void limit_reserve_root(struct f2fs_sb_info *sbi) { - block_t limit = min((sbi->user_block_count << 1) / 1000, + block_t limit = min((sbi->user_block_count >> 3), sbi->user_block_count - sbi->reserved_blocks); - /* limit is 0.2% */ + /* limit is 12.5% */ if (test_opt(sbi, RESERVE_ROOT) && F2FS_OPTION(sbi).root_reserved_blocks > limit) { F2FS_OPTION(sbi).root_reserved_blocks = limit;