Linux-ext4 Archive mirror
 help / color / mirror / Atom feed
From: Srivathsa Dara <srivathsa.d.dara@oracle.com>
To: linux-ext4@vger.kernel.org
Cc: tytso@mit.edu, adilger.kernel@dilger.ca,
	rajesh.sivaramasubramaniom@oracle.com, junxiao.bi@oracle.com
Subject: [PATCH] ext4: Enable meta_bg only when new desc blocks are needed
Date: Tue, 27 Feb 2024 13:13:29 +0000	[thread overview]
Message-ID: <20240227131329.2608466-1-srivathsa.d.dara@oracle.com> (raw)

This patch addresses an issue observed when resize_inode is disabled
and an online extension of a filesysyem is performed. When a filesystem
is expanded to a size that does not require a addition of a new
descriptor block, the meta_bg feature is being enabled even though no
part of the filesystem uses this layout.

This patch ensures that the meta_bg feature is only enabled if
any of the added block groups utilize meta_bg layout.

Signed-off-by: Srivathsa Dara <srivathsa.d.dara@oracle.com>
---
 fs/ext4/resize.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/ext4/resize.c b/fs/ext4/resize.c
index 928700d57eb6..99b52f26e818 100644
--- a/fs/ext4/resize.c
+++ b/fs/ext4/resize.c
@@ -1996,7 +1996,7 @@ int ext4_resize_fs(struct super_block *sb, ext4_fsblk_t n_blocks_count)
 		}
 	}
 
-	if ((!resize_inode && !meta_bg) || n_blocks_count == o_blocks_count) {
+	if ((!resize_inode && !meta_bg && n_desc_blocks > o_desc_blocks) || n_blocks_count == o_blocks_count) {
 		err = ext4_convert_meta_bg(sb, resize_inode);
 		if (err)
 			goto out;
-- 
2.39.3


             reply	other threads:[~2024-02-27 13:13 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-27 13:13 Srivathsa Dara [this message]
2024-03-06  4:02 ` [PATCH] ext4: Enable meta_bg only when new desc blocks are needed Ritesh Harjani
2024-03-06  6:55   ` Srivathsa Dara
2024-03-14  3:54 ` Theodore Ts'o

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240227131329.2608466-1-srivathsa.d.dara@oracle.com \
    --to=srivathsa.d.dara@oracle.com \
    --cc=adilger.kernel@dilger.ca \
    --cc=junxiao.bi@oracle.com \
    --cc=linux-ext4@vger.kernel.org \
    --cc=rajesh.sivaramasubramaniom@oracle.com \
    --cc=tytso@mit.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).