From patchwork Sat Oct 22 07:19:54 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 7191 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4242:0:0:0:0:0 with SMTP id s2csp1089383wrr; Sat, 22 Oct 2022 00:43:07 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6g/TiZ1+4LKWF8Yi1Hk1aqoOCJrhL70oDydE0fKmYgiu/KTMYhq19i7YGhaKPVkqDUgfsZ X-Received: by 2002:a63:e755:0:b0:46e:c2ac:5fd1 with SMTP id j21-20020a63e755000000b0046ec2ac5fd1mr4782333pgk.184.1666424586778; Sat, 22 Oct 2022 00:43:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666424586; cv=none; d=google.com; s=arc-20160816; b=RACU3KoOUOZT7kS0AUgzcbjzAAH3ZiPYQWzPz58fATPvLi0DoIDR/1p4EIRyIZHXX2 SkSpxT1wondvR+EjJZnGKJe+CL7Oa7S+v+LkuTq7y6LatYgQlXmyhY9K1QxlTmPt4rkG UuJNrqnq9tfun4yWyahmmJatvTWijORQwDXtUAU20iwxSXXxyHHgSTw8FKAYQI7dj5mr MBNnmLxzQfweaeV8bME7CpAv3W0APqJS0MRE7iRf67YIEGMcPqVmmwVImMjikplRr4MB X/q9rXapoJ57+mgjqzIfcmq8rKjoRzIUtVwTP9Yimp1d9ymyIJiNyq2zdvhDsJeSbOhj RpmQ== 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=i09F9aK61i18uWrWDv3q6OXvh4OA70meTBawwoC0/9Q=; b=sHZszs3SVYTjMak4iTR0nxOpzkLe9jC3csfPAhKromVhqL3bU6DcEyXipiIE5PwFx1 Ui4hn/5jgAcLKNfYsy2zE7lZyzFTQPtOxC4UBtX9sv9jW/RBEQ7GnddcycWKtNA6myHJ j3eK301pKTzfKKR8O0KoFgcEMq4YIFS9pQqsb3rqxQ45TfwC1fExcExkeOiGYW4IJWEk OBsfsYxGr/QeREYZqpALlUcQwF1AMcrw7+6z/QkrYaIO+lxHEMPh+disZttXcnavv5wt PvJbdFzb6CP4cyqzFn0dHsVrhrKdCBRNuPwAY78kZlf9rMji9axSGvzYgJFT9oUUx3cl 9wEA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=GlhTD63G; 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 y31-20020a056a00181f00b00562a1693523si28846156pfa.20.2022.10.22.00.42.54; Sat, 22 Oct 2022 00:43:06 -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=GlhTD63G; 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 S231261AbiJVHmi (ORCPT + 99 others); Sat, 22 Oct 2022 03:42:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44772 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231139AbiJVHlz (ORCPT ); Sat, 22 Oct 2022 03:41:55 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AEF55EF5B6; Sat, 22 Oct 2022 00:40:14 -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 3E18AB82E01; Sat, 22 Oct 2022 07:39:18 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 87438C433D6; Sat, 22 Oct 2022 07:39:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666424356; bh=LUCqnL0CpNQQy7m2QqQFuPp6xdW28Ne5xn1QZwADrrY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GlhTD63GR/dN/saezdaWREv9yiwUnHW3BSxEmj1lur/TJG0J6X0xCnyTj7jMM9Qr5 dTTPjea/6ykYVQtq3O7z83+epPzz2F9i25aUKd2CTqbfF6rDPn7K53XRRVehjFOsiJ HK/m7F2dUvNWOgzAcsad26POhjCUpKQVvRdaKZ4Y= 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.19 115/717] f2fs: increase the limit for reserve_root Date: Sat, 22 Oct 2022 09:19:54 +0200 Message-Id: <20221022072435.740997775@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221022072415.034382448@linuxfoundation.org> References: <20221022072415.034382448@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 X-Spam-Status: No, score=-7.3 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?1747372827561719193?= X-GMAIL-MSGID: =?utf-8?q?1747372827561719193?= 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 @@ -298,10 +298,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;