Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp1013964rwi; Wed, 19 Oct 2022 05:51:01 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5BeNL0W+Cn2SiIfxsxSiGLuzWONGOyVhMbLLfA0T3ot5ZbIWDeBLhxQUgdSdoaPlen36KE X-Received: by 2002:a17:907:918e:b0:78d:b87e:7051 with SMTP id bp14-20020a170907918e00b0078db87e7051mr6692816ejb.227.1666183861177; Wed, 19 Oct 2022 05:51:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666183861; cv=none; d=google.com; s=arc-20160816; b=x0kBN0in2zgvu1LDUvlJ8HZkq+tiZM/45hbT4n8CcOzp5gKEdhYyUZkiVLQa1ABKW/ pteygqnYIeFgEhyG0iXg2mvjiAIawD6rE0ZzX9hGFWgfVrKyDubH+YzMvwUhWeQJsXcC R3ok/6qvPF90nmXIriT0F54SsyKCxZ6GwpzAf+J/qZ5numq9Av9AnH3+iQ4bRVi4Cleh C2DdVH0ARbPEL1bjDQOY/k6okSoD+umLp05Oe/qkjPnkYJrDd1zm10SQuhPVwkUPSN9U Jh0AaE/ZM+v7cgqJ+roo7/9+GAIbItzl6wrT20vE2PlVZr8BWBYHMRPsYnswIH7+MbY6 Zlzg== 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=p7kAaSM5Mdw9etajGhkk6pdijn2aBe5h+ej22Triwe8=; b=oanCp5YW9X+LbPjPEKLGyjVNivdSdlOX1Love2qcAlMeAyIjg+gJUljS1rCou0GtzJ HDPFaRk9M3NBXP9qzrplNfEX8wtOVnHFSY7mj058XzsHhUkixSOZZEQLmy324FiCPmik D9+j1stKOh6RUblZkuu77EELKOlouzH0GX0w/tp8kOgJIpDgLVI1tQsjyAkTwrAw4Vt8 lcnVVKeTU4A3PyNo7Y2DhXMfNtUScFR6h4sB3C9E7UcIUD1SRv+HJ8X0x7Pc83EBqi1g B2U0Vr+bk8RCLcaw8p1PnL/pxisdVeHMPx/ctpA7eqYCDdsaPgd4kzV8G/QPkzsI/3J1 rFmw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=HOEu3WtB; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t11-20020aa7d4cb000000b0044d7a93e44dsi12722070edr.579.2022.10.19.05.50.33; Wed, 19 Oct 2022 05:51:01 -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=HOEu3WtB; 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 S232879AbiJSMRT (ORCPT + 99 others); Wed, 19 Oct 2022 08:17:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55464 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232859AbiJSMQ5 (ORCPT ); Wed, 19 Oct 2022 08:16:57 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7A5BF192D94; Wed, 19 Oct 2022 04:52:42 -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 ams.source.kernel.org (Postfix) with ESMTPS id 867FDB822EE; Wed, 19 Oct 2022 08:43:22 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id EB737C433D6; Wed, 19 Oct 2022 08:43:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666169001; bh=ENqjI30oM3X1HTevosEQ8wfvgkE/7JDm0ZpMwQO+m1g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=HOEu3WtBj0F6qrTwxAcQQnGb3MpUwoobjeM0TjPHuaGhPcLYbuV7DnSlPQkqPKFq5 3ArQMclZ7kvMBViBzr9KKuTXNrp0838mA5250FRgJr+NbEuNWfvPQ0C0VZlYmOSkd+ 8JpGyzHvoCSVDOsY0VrRnynM7c9sNXJlGeHfNhS8= 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 6.0 126/862] f2fs: increase the limit for reserve_root Date: Wed, 19 Oct 2022 10:23:33 +0200 Message-Id: <20221019083255.521198948@linuxfoundation.org> X-Mailer: git-send-email 2.38.0 In-Reply-To: <20221019083249.951566199@linuxfoundation.org> References: <20221019083249.951566199@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.4 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 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 @@ -301,10 +301,10 @@ static void f2fs_destroy_casefold_cache( 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;