From patchwork Mon Oct 24 11:29:06 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 9291 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp463448wru; Mon, 24 Oct 2022 06:48:00 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4+Hb3wp9peEHBxWGpAo3tL18zJZPVBglyFNClDBvU6t5hnwPLPVuTrCCpabNdUn7B3xlnc X-Received: by 2002:a17:906:478e:b0:78e:4b5:a547 with SMTP id cw14-20020a170906478e00b0078e04b5a547mr27898603ejc.81.1666619279877; Mon, 24 Oct 2022 06:47:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666619279; cv=none; d=google.com; s=arc-20160816; b=HELWanocP0xmJAxfQFFzf+BWX9JtUC6Q3riEcAKzKM7EG1AQ1P1hXrYzIAoAfVJIqQ mYkarIVo/WGPRbIJWuyVA5LA/38VJoqsVz6/e7ur6nHM01r/lkxfGHkoB9/5mxHBTRoR /HVoEoR9z9modYmh0xnqSJtBpL9+9xzka/RPOGF2vnwzlOr7HubiPCy6s1bQQWdRWaCD wxneLaMPvBEFgcmT3PozvJuBMa+RhiJie6BzcwQ/QZhvy6k9X/78dNpCx6jQpbypYBMW Ia90ZE51XRRG7GyjEh6JMk7vRTlEi7UANzNgYmw3PIiD5HZBVxqVu1tYMKQ580dfOnzf TjsQ== 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=QLJwnGS4T6bWkE+g00VHGf3iRxatkX5lxDXAdpGRsRM=; b=rwDz6Ou9UXiBIbGtWHfRLmpBGUBBzPieYgWWIyH13JqcMbn+9ODxYwIHD1v948rojS MitX2tj8dDilIBoqAXVx0x9XK2pCjPZWK9o49mN/+u9jr2ArDWgYhYMl+O0hET8S1vQ/ dtCSr6UU7x6XMnVCjcA2Ujd3ezxopZVxipmP7revdhLf4jibRwiFFX1Jbi2PUHBrhMF+ SWWh8NvDms82dTPgTO52z9f1qAlbFJy7z7Dxu+8oNC+S0aZAzyyQy4kCAfrd/DomN+Co s0NVBLFYg3eTmlMf8mcs2RyLf3dYK3cinf/RnQR+zYpgRSUqQE4knZaQjAmvVL810dF1 0dWQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=wNb6YY4g; 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 z1-20020a056402274100b0045c786162f5si6277928edd.567.2022.10.24.06.47.35; Mon, 24 Oct 2022 06:47:59 -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=wNb6YY4g; 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 S236273AbiJXNnL (ORCPT + 99 others); Mon, 24 Oct 2022 09:43:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58172 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236561AbiJXNkk (ORCPT ); Mon, 24 Oct 2022 09:40:40 -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 0B4EAB276C; Mon, 24 Oct 2022 05:37:37 -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 3DD48B811F9; Mon, 24 Oct 2022 12:06:13 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6DEF8C433C1; Mon, 24 Oct 2022 12:06:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666613171; bh=ZDdK79/PqGnACpozGpN+trTIzki0JQbZTUwIzXIGj5U=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=wNb6YY4gLTdPMC29iShPm5p28766CDJ/R2MkR4U5Pb3cxqlf5jf9NziD3/55d1rG6 lj+RKGhewfefSKYQWdUGPuBjmf0XizY2woEXrunA+hrjkvOTXpRYCKGt3RY13xiERR Mvvb9ShpW741ZIU/ZC2DRN7MIhmNh0F5kJtYd17o= 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.4 036/255] f2fs: increase the limit for reserve_root Date: Mon, 24 Oct 2022 13:29:06 +0200 Message-Id: <20221024113003.640625457@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221024113002.471093005@linuxfoundation.org> References: <20221024113002.471093005@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?1747576977697470966?= X-GMAIL-MSGID: =?utf-8?q?1747576977697470966?= 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 @@ -255,10 +255,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;