Message ID | 20240223205535.307307-5-jaegeuk@kernel.org |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel+bounces-79150-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:a81b:b0:108:e6aa:91d0 with SMTP id bq27csp839630dyb; Fri, 23 Feb 2024 12:56:56 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVfvOzoJi2I3zcuFXCAWy+LF92WSWJemldvdoLqCOcmKFpozsoML+5pRqngSOY0Dn9+I+aUjjGznZMTE0AqLkhJ/kVK9A== X-Google-Smtp-Source: AGHT+IEIKA3jPYj7yHbFOO5DjcTbYO7SlIhl8O5Qxlwxd0QvluG2izmB7OXVkDDPHK0dXo2+9thx X-Received: by 2002:a17:906:16d2:b0:a3e:6aff:5e74 with SMTP id t18-20020a17090616d200b00a3e6aff5e74mr627633ejd.22.1708721815925; Fri, 23 Feb 2024 12:56:55 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708721815; cv=pass; d=google.com; s=arc-20160816; b=tnr6dBcjbjRQJbdzBGX07aFL15AOnwgsXaroXyrS3d6LAjkr9AZv1hMpinCBElv4+c WRfJQwfgtrY0f0vEyQB5nhf/69x9Zj4JwKN9Qzw+IXs7XdPmLv0tqE6JkzTVU3w2cn1V ccA/24THxUJGzv5FovNndNAroxgWxSuB5jWy24bFPyo5nOEs2lO0qUWI8BEhghvkfp7t o2dQwdS1QDofa22979jxmhbI22RzLVIUQbMyVjgHOXqkRPX7QNa3N8gdI9aJyPtqd/2/ EZWPV+YoUwqWW+G+jnnANh+c8dyRYKaUmANIlk6btTust8/N10zLB9h0Wo5aN2CWTRnA mB8w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=KEK4PKZpiKuqikEuPIITFI5x9Ipginm3gnaq5OfdLpo=; fh=rqHW7NazYv3wAmgqDKAbZUXWTmf0VaM5epB9R4zfTUE=; b=yTT/qBR4oMO4axb29HKIT2BQArpUlxFjco8h7UXhaxL5ya8C3zaLYYPSQRhXH9+Mux GYTvSKJe8ypjYEvtNhpYG/Bt4kMX27TNRE517crJp3ItqjL4PFERyO4AIAov/j287deh mC7T25dIWsylozNOuMqWCW4dumItx1DjEI7ipGTJaq42O8U1ZeF8AvZcfZC4pwAXIPsU izKn7Uie2NXGyJPnXh1qhzzf/DNSOQwLaJr6MZ+es1t7sOmwtZaae5+YHOkP/Hs1FKd8 eJ/p197Z2J+6K4kq1DaHTT/4wYnxh/EEBCSpc3L/z0WvqnIU4EPOSc2l8HE0pHzy5o5a B0eQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=hmh02COf; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-79150-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-79150-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id p24-20020a170906229800b00a3e3bba74absi5994073eja.833.2024.02.23.12.56.55 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 23 Feb 2024 12:56:55 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-79150-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=hmh02COf; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-79150-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-79150-ouuuleilei=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 866A41F2141E for <ouuuleilei@gmail.com>; Fri, 23 Feb 2024 20:56:55 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3ED0414DFC1; Fri, 23 Feb 2024 20:55:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="hmh02COf" 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 AF3841DDC3 for <linux-kernel@vger.kernel.org>; Fri, 23 Feb 2024 20:55: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=1708721740; cv=none; b=ks7f7+Bd60gLyADcdFd5rjB6t9ZQgqvEEKQq7vt6JI/Wdo+m8WcIdGDexCo0MwReJpWWm7Kyp4eEajdTb0HipuwHvISCZe+fj3FySeGmW87IMp/Nj9eX8Tuiv0HpUQLY6qIboquKmkmApth0rW7Y0W00FJ0HEMu4Qm6fIHXyBoM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708721740; c=relaxed/simple; bh=Dks7ZYdpho4cTIrGeKroPJwikwZpUsV1Ym/LDVuEhMY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=aWeebP0C4O0Coc465eSPgr5yZvered3QWVyiIAuAVZrS46XVwPVdL+XsjUynnAhiNXxsur7il3auPsEQebCbuoMqlj+Z9M2rhNCp974DsE7V/nFabpvW2kvKMflKtLsYn0WUjYYatd3fYvSaVGDOcPiQ0aSs9uxk5C7LLAP7pto= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=hmh02COf; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 351D1C43390; Fri, 23 Feb 2024 20:55:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1708721740; bh=Dks7ZYdpho4cTIrGeKroPJwikwZpUsV1Ym/LDVuEhMY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hmh02COfYfzXOAY/wQfnzDRk4Ol3gGYIn1gDcG02Bf2LrYPE/K1cx7LX/SVL2WF9Y WqtEQE8K4EUTV2MyulSisJi14ElRtimAP1qCg6blP4+VPLcEwhbntU9XTDIWE/O1uo 5lUk4hBsmPYcD6+EtNZWUM12c0f53Af/Wqjv6SyFL+PV0rqTv30oxOySWjpKKJJFlb rKjLFIb9CQXbR8X0t/AlGQCS5xV28QufjgyMHagNp6LWXie1aXQR5TuaDqINBkqCrR ToQ3A0XaoLjbIBW1jxCWMyUBzQW/LHF72Vvv1eMGAY5df4w/yuz5kj/kgyGhoyltk3 j410fPAfilfUA== From: Jaegeuk Kim <jaegeuk@kernel.org> To: linux-kernel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net Cc: Jaegeuk Kim <jaegeuk@kernel.org> Subject: [PATCH 5/5] f2fs: allow to mount if cap is 100 Date: Fri, 23 Feb 2024 12:55:35 -0800 Message-ID: <20240223205535.307307-5-jaegeuk@kernel.org> X-Mailer: git-send-email 2.44.0.rc0.258.g7320e95886-goog In-Reply-To: <20240223205535.307307-1-jaegeuk@kernel.org> References: <20240223205535.307307-1-jaegeuk@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: <linux-kernel.vger.kernel.org> List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org> List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1791724686707588223 X-GMAIL-MSGID: 1791724686707588223 |
Series | [1/5] f2fs: check number of blocks in a current section | |
Commit Message
Jaegeuk Kim
Feb. 23, 2024, 8:55 p.m. UTC
Don't block mounting the partition, if cap is 100%.
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
---
fs/f2fs/segment.c | 3 +++
1 file changed, 3 insertions(+)
Comments
On 2024/2/24 4:55, Jaegeuk Kim wrote: > Don't block mounting the partition, if cap is 100%. > > Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org> Reviewed-by: Chao Yu <chao@kernel.org> Thanks,
On Fri, Feb 23, 2024 at 12:56 PM Jaegeuk Kim <jaegeuk@kernel.org> wrote: > > Don't block mounting the partition, if cap is 100%. > > Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org> > --- > fs/f2fs/segment.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c > index 6d586ae8b55f..f11361152d2a 100644 > --- a/fs/f2fs/segment.c > +++ b/fs/f2fs/segment.c > @@ -904,6 +904,9 @@ int f2fs_disable_cp_again(struct f2fs_sb_info *sbi, block_t unusable) > { > int ovp_hole_segs = > (overprovision_segments(sbi) - reserved_segments(sbi)); > + > + if (F2FS_OPTION(sbi).unusable_cap_perc == 100) > + return 0; With this, f2fs will not execute GC. What is this 100 unusable_cap_perc used for? > if (unusable > F2FS_OPTION(sbi).unusable_cap) > return -EAGAIN; > if (is_sbi_flag_set(sbi, SBI_CP_DISABLED_QUICK) && > -- > 2.44.0.rc0.258.g7320e95886-goog > > > > _______________________________________________ > Linux-f2fs-devel mailing list > Linux-f2fs-devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
On 02/26, Daeho Jeong wrote: > On Fri, Feb 23, 2024 at 12:56 PM Jaegeuk Kim <jaegeuk@kernel.org> wrote: > > > > Don't block mounting the partition, if cap is 100%. > > > > Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org> > > --- > > fs/f2fs/segment.c | 3 +++ > > 1 file changed, 3 insertions(+) > > > > diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c > > index 6d586ae8b55f..f11361152d2a 100644 > > --- a/fs/f2fs/segment.c > > +++ b/fs/f2fs/segment.c > > @@ -904,6 +904,9 @@ int f2fs_disable_cp_again(struct f2fs_sb_info *sbi, block_t unusable) > > { > > int ovp_hole_segs = > > (overprovision_segments(sbi) - reserved_segments(sbi)); > > + > > + if (F2FS_OPTION(sbi).unusable_cap_perc == 100) > > + return 0; > > With this, f2fs will not execute GC. What is this 100 > unusable_cap_perc used for? Theoritically, it won't, but I was hitting a GC loop, and I suspected a wrong section/segment layout. So, I posted the below, and guess we need this patch as workaround. https://patchwork.kernel.org/project/f2fs/patch/20240224011411.3820719-1-jaegeuk@kernel.org/ > > > if (unusable > F2FS_OPTION(sbi).unusable_cap) > > return -EAGAIN; > > if (is_sbi_flag_set(sbi, SBI_CP_DISABLED_QUICK) && > > -- > > 2.44.0.rc0.258.g7320e95886-goog > > > > > > > > _______________________________________________ > > Linux-f2fs-devel mailing list > > Linux-f2fs-devel@lists.sourceforge.net > > https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
On Mon, Feb 26, 2024 at 2:47 PM Jaegeuk Kim <jaegeuk@kernel.org> wrote: > > On 02/26, Daeho Jeong wrote: > > On Fri, Feb 23, 2024 at 12:56 PM Jaegeuk Kim <jaegeuk@kernel.org> wrote: > > > > > > Don't block mounting the partition, if cap is 100%. > > > > > > Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org> > > > --- > > > fs/f2fs/segment.c | 3 +++ > > > 1 file changed, 3 insertions(+) > > > > > > diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c > > > index 6d586ae8b55f..f11361152d2a 100644 > > > --- a/fs/f2fs/segment.c > > > +++ b/fs/f2fs/segment.c > > > @@ -904,6 +904,9 @@ int f2fs_disable_cp_again(struct f2fs_sb_info *sbi, block_t unusable) > > > { > > > int ovp_hole_segs = > > > (overprovision_segments(sbi) - reserved_segments(sbi)); > > > + > > > + if (F2FS_OPTION(sbi).unusable_cap_perc == 100) > > > + return 0; > > > > With this, f2fs will not execute GC. What is this 100 > > unusable_cap_perc used for? > > Theoritically, it won't, but I was hitting a GC loop, and I suspected a wrong > section/segment layout. So, I posted the below, and guess we need this patch > as workaround. > > https://patchwork.kernel.org/project/f2fs/patch/20240224011411.3820719-1-jaegeuk@kernel.org/ Reviewed-by: Daeho Jeong <daehojeong@google.com> > > > > > > if (unusable > F2FS_OPTION(sbi).unusable_cap) > > > return -EAGAIN; > > > if (is_sbi_flag_set(sbi, SBI_CP_DISABLED_QUICK) && > > > -- > > > 2.44.0.rc0.258.g7320e95886-goog > > > > > > > > > > > > _______________________________________________ > > > Linux-f2fs-devel mailing list > > > Linux-f2fs-devel@lists.sourceforge.net > > > https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c index 6d586ae8b55f..f11361152d2a 100644 --- a/fs/f2fs/segment.c +++ b/fs/f2fs/segment.c @@ -904,6 +904,9 @@ int f2fs_disable_cp_again(struct f2fs_sb_info *sbi, block_t unusable) { int ovp_hole_segs = (overprovision_segments(sbi) - reserved_segments(sbi)); + + if (F2FS_OPTION(sbi).unusable_cap_perc == 100) + return 0; if (unusable > F2FS_OPTION(sbi).unusable_cap) return -EAGAIN; if (is_sbi_flag_set(sbi, SBI_CP_DISABLED_QUICK) &&