From patchwork Sat Feb 24 01:14:11 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jaegeuk Kim X-Patchwork-Id: 13570186 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.sourceforge.net (lists.sourceforge.net [216.105.38.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A4B65C54798 for ; Sat, 24 Feb 2024 01:14:27 +0000 (UTC) Received: from [127.0.0.1] (helo=sfs-ml-4.v29.lw.sourceforge.com) by sfs-ml-4.v29.lw.sourceforge.com with esmtp (Exim 4.95) (envelope-from ) id 1rdgcT-0002lz-13; Sat, 24 Feb 2024 01:14:25 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-4.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1rdgcS-0002lt-Ak for linux-f2fs-devel@lists.sourceforge.net; Sat, 24 Feb 2024 01:14:24 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=Content-Transfer-Encoding:MIME-Version:Message-ID: Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=7/7etoDVxa2GaekHSFIR1OImQmXOmWYVlrE0hdes3cU=; b=flz+1r8O6Mf21cqzzkEs2REGQG VSDkKPPJJ90/vycH1KwlGcrxR72IA6fDyU1q+i8Vhww3pnrIYtCemD4GCSUeldjwb5ofO5HRu8vae +DpA1712iNTNGHgJ8oELiZ5+ZvV1mtxJdFrW1KeiXmzhOKeyYeb8Y2JOxJAhqRkNppog=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=Content-Transfer-Encoding:MIME-Version:Message-ID:Date:Subject:Cc:To:From :Sender:Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Id:List-Help:List-Unsubscribe:List-Subscribe:List-Post: List-Owner:List-Archive; bh=7/7etoDVxa2GaekHSFIR1OImQmXOmWYVlrE0hdes3cU=; b=S x4nqZyx0mxf9JMqwudk5eJwwW39DMJWJkQoUnw13Db/8bHAA9xTAV+/8KLwOvFVvBv/lVtNedK/dE fQ/bokN1euHTPTLUScQQcphX882vmpKxCkeqFfSCHiNgCSb85zXK7inwJ4orOrn1vHx8MW9gsr8No SvjSSauQfihr8geg=; Received: from dfw.source.kernel.org ([139.178.84.217]) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.95) id 1rdgcN-0005bc-Ra for linux-f2fs-devel@lists.sourceforge.net; Sat, 24 Feb 2024 01:14:24 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 70683618EA for ; Sat, 24 Feb 2024 01:14:14 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0F8CCC433F1; Sat, 24 Feb 2024 01:14:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1708737254; bh=t6bpmHREMYzl4Sh4aRRosfkE6F9NITSKrV4bmyBQCfk=; h=From:To:Cc:Subject:Date:From; b=myU8pj7yDRMWYqCJUNWkiGjFDJHS8OUE670INLraKYknIO/Z09rg/mqRNA9QeOdqK WSlNrriituWHgpk/uDvkZFSyw0YJD50VYs2l84v3+ygkuAi9QPlruKb0TgsrCPeQcE 0pobnviMxRn1QiuxGEng8hI1KIWYzsM23EjIAvluxiCSwYz0QCPvRJopIGOyhdXsEn +bLkmXSIYzWyNRvcKxPE5TAjxZQAjiuCFZzI7IxdwJZlS/cobfYqjeiArTSXnbowWb irE8M+dmM66awsKHsAEbfQyhySGjr6hF34Lbgm5MFyQgQQidiM4Dk/siNYblmVARwK DwOr/7y0lFyPQ== From: Jaegeuk Kim To: linux-f2fs-devel@lists.sourceforge.net Date: Fri, 23 Feb 2024 17:14:11 -0800 Message-ID: <20240224011411.3820719-1-jaegeuk@kernel.org> X-Mailer: git-send-email 2.44.0.rc0.258.g7320e95886-goog MIME-Version: 1.0 X-Headers-End: 1rdgcN-0005bc-Ra Subject: [f2fs-dev] [PATCH] mkfs.f2fs: should give section-aligned reserved segments X-BeenThere: linux-f2fs-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jaegeuk Kim Errors-To: linux-f2fs-devel-bounces@lists.sourceforge.net The reserved segments should be aligned to the section boundary. Signed-off-by: Jaegeuk Kim Signed-off-by: Jaegeuk Kim Reviewed-by: Daeho Jeong --- include/f2fs_fs.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/f2fs_fs.h b/include/f2fs_fs.h index 9056e02acd29..2e93503cada9 100644 --- a/include/f2fs_fs.h +++ b/include/f2fs_fs.h @@ -1771,7 +1771,8 @@ static inline double get_reserved(struct f2fs_super_block *sb, double ovp) else reserved = (100 / ovp + 1 + NR_CURSEG_TYPE) * segs_per_sec; - return reserved; + /* Let's keep the section alignment */ + return round_up(reserved, segs_per_sec); } static inline double get_best_overprovision(struct f2fs_super_block *sb)