Received: by 2002:ab2:6a05:0:b0:1f8:1780:a4ed with SMTP id w5csp21986lqo; Thu, 9 May 2024 11:19:46 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVVh2uhkF3y1S2BHN0RxzYEWHZlbVGGlngdh8J9np+/G4McD669J6vj8XexViwQifgxHvtsi4GQtRPazFKG5E9yF9V+6Csv+Wiafj8siw== X-Google-Smtp-Source: AGHT+IHPrPu1HDqKY4KDu4j9w+dWuhFOQr5fsihlRAUAKNOsFvI05zbDeOoTMgs37WI535I5O4Sb X-Received: by 2002:ac2:544f:0:b0:51f:52d9:d552 with SMTP id 2adb3069b0e04-5221016e842mr162364e87.45.1715278786794; Thu, 09 May 2024 11:19:46 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715278786; cv=pass; d=google.com; s=arc-20160816; b=JujfcuAAr/hxFx60dr/jvNzoImmf8nVtWozHQ2JbvcChN7y7eVh37oo7YJw3XpH7eo lpQuriFy//BUQbF/VpfrEGjfCET22v6AXntxsSACfRIrXbKg4wfiDraw20FY6dNQju3R YFoqh6WfqD8f7iJaYgV7K+n/ElXQFpVr9X3kOoBeCneFNvi4u6HMSeXQ1qH2agsMBzRK 2e/5I2s535KBDahpQ+a9NWwwgByYkztYfBAEDGI09RP4dLMzuXW265lWv9fY8CNf5gwv k9qyrjlUg/+StuetqI2BuskFzL4IrOqelVglsl3KH+EMRCTJxsRADGGAnSbgjOtstpVe bTEw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=Mg3HwjqEc2ZWsKqhcpViEOtUQpAVaqFthT91OSEbTLU=; fh=ZaK2vudNijy95H0GvyYVBWTmhTw8nJYwWXkLewFdkfY=; b=oziZBC3cUpW7vWkVavnl5nVJ02+exZJDDWErTD5Da26r8mE1QTXkxaMDwontCa0nli Dl7p2mM2op4is7Yc3VXOUK5ShxmTsSopoBjeWQCK7XbciD7AykflbW4K1rbXKb8IKZOQ 2Tymx2x4FfxVRefOgUjDkbQNEc27XXd0eCvZX9WgirJlMDAvqAhdiNsHtEukAe/3tWek jmYRGo2hynZcDY4yw6+J1JQeWYuqjAHZ5Z/CaQP70tMy14BnZtQFCu3evd1oG60JjLAO dGokii8p6qv+osBhNy2wNtTbx+CO302vpXkk6BiKFOYTvvwl/jh4KNOY+aDQb5Z71vS8 povw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=sfCzvEu3; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-174760-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-174760-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id a640c23a62f3a-a5a17c03d1dsi108349366b.900.2024.05.09.11.19.46 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 May 2024 11:19:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-174760-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=sfCzvEu3; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-174760-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-174760-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 61D701F22D62 for ; Thu, 9 May 2024 18:19:46 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D859977104; Thu, 9 May 2024 18:19:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="sfCzvEu3" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0D01B770FB for ; Thu, 9 May 2024 18:19:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715278781; cv=none; b=TT2QSzP+bJRL6ZLQcaqjOqxnHnQyEbc6f+x1N/TZJOveBRJ4FRtU7+mAGHMvcrf3avgqgIISqS6ACrANZzdTD5HwGlM/Q+n8gCT3FXAl1rhWDICmyPifOfoxAyySL2hzqvba/QdP+aq+/F9BcdH5EtI+xNZBppQrx5WGt/HrixA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715278781; c=relaxed/simple; bh=/t2pB7QSKYBgF36Vts5qeGbyY0WPmNyjKYluvoaa0e8=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=J02XKun1O6gNAKPuIksN9wx8cP3D4oIeXhlkpuAhuv7N8rFVSSYn0F4cJg/fz8sN69eovYSxF5sGxFM1qbWJtQ+ktjJ8+di8Bu0Z2MWfy8+1oBjy13MRF3PhGWhi1skSGQ4q7gYihzxW/ZCSuCSD9csoQv2SLAOUqJaqottUD8E= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=sfCzvEu3; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 50157C116B1; Thu, 9 May 2024 18:19:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1715278780; bh=/t2pB7QSKYBgF36Vts5qeGbyY0WPmNyjKYluvoaa0e8=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=sfCzvEu3z3WHRI1nraVl6WeK1wotw9++4gucuIDqKxMu5wUS/QYU4aFM+u13Ot/29 ilihfAxTJySycWkwZWHBRBctf/dDFrBNmw9zUC0zIAvXcvLXHVi/MFpp7ZGqFUhZoG lWBKWGZtV8iFVlZqyQcngV3ZaHRB+DoNcAYC84c/QWFY26T2fwO3th9B4WN4yncRKA 6REhCvNjCrscVWbiHuWWP4lrQi8mAqL6PXjCg7wdpgeftsOHUaq1tVXBvgdkmhUqIV LhYk/fUpJnP5+zYDzLugEYyf57oPesdOBkk5wL4gTP5LkSTNeE0V2P06vtnPjAEKCQ 1rYQMvEWRSNuQ== Date: Thu, 9 May 2024 18:19:38 +0000 From: Jaegeuk Kim To: Daeho Jeong Cc: linux-kernel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, kernel-team@android.com, Daeho Jeong Subject: Re: [f2fs-dev] [PATCH] f2fs: allow dirty sections with zero valid block for checkpoint disabled Message-ID: References: <20240507175628.2460390-1-daeho43@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240507175628.2460390-1-daeho43@gmail.com> On 05/07, Daeho Jeong wrote: > From: Daeho Jeong > > Following the semantic for dirty segments in checkpoint disabled mode, > apply the same rule to dirty sections. > > Signed-off-by: Daeho Jeong > --- > fs/f2fs/segment.c | 7 +++++-- > 1 file changed, 5 insertions(+), 2 deletions(-) > > diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c > index 6474b7338e81..2463398b243f 100644 > --- a/fs/f2fs/segment.c > +++ b/fs/f2fs/segment.c > @@ -771,8 +771,11 @@ static void __locate_dirty_segment(struct f2fs_sb_info *sbi, unsigned int segno, > block_t valid_blocks = > get_valid_blocks(sbi, segno, true); > > - f2fs_bug_on(sbi, unlikely(!valid_blocks || > - valid_blocks == CAP_BLKS_PER_SEC(sbi))); > + if (!is_sbi_flag_set(sbi, SBI_CP_DISABLED)) > + f2fs_bug_on(sbi, unlikely(!valid_blocks)); > + > + f2fs_bug_on(sbi, unlikely(valid_blocks == > + CAP_BLKS_PER_SEC(sbi))); What about: f2fs_bug_on(sbi, (!is_sbi_flag_set(sbi, SBI_CP_DISABLED) && !valid_blocks) || valid_blocks == CAP_BLKS_PER_SEC(sbi)); > > if (!IS_CURSEC(sbi, secno)) > set_bit(secno, dirty_i->dirty_secmap); > -- > 2.45.0.rc1.225.g2a3ae87e7f-goog > > > > _______________________________________________ > Linux-f2fs-devel mailing list > Linux-f2fs-devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel