mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Kemeng Shi <shikemeng@huaweicloud.com>
To: Theodore Ts'o <tytso@mit.edu>
Cc: adilger.kernel@dilger.ca, linux-ext4@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 11/13] ext4: correct gdblock calculation in add_new_gdb_meta_bg to support non first group
Date: Thu, 17 Aug 2023 11:38:34 +0800	[thread overview]
Message-ID: <29c9e94f-63b3-e757-9d6d-c9beaa0e0c19@huaweicloud.com> (raw)
In-Reply-To: <20230816034543.GS2247938@mit.edu>



on 8/16/2023 11:45 AM, Theodore Ts'o wrote:
> On Thu, Jun 29, 2023 at 08:00:42PM +0800, Kemeng Shi wrote:
>> In add_new_gdb_meta_bg, we assume that group could be non first
>> group in meta block group as we call ext4_meta_bg_first_block_no
>> to get first block of meta block group rather than call
>> ext4_group_first_block_no for passed group directly. Then ext4_bg_has_super
>> should be called with first group in meta group rather than new added
>> group. Or we can call ext4_group_first_block_no instead of
>> ext4_meta_bg_first_block_no to assume only first group of
>> meta group will be passed.
>> Either way, ext4_meta_bg_first_block_no will be useless and
>> could be removed.
> 
> Unfortunately, I spent more time trying to understand the commit
> description than the C code.  Perhaps this might be a better way of
> describing the situation?
> 
Sorry for my poor language again, :( I will try to improve this.
> The ext4_new descs() function calls ext4_meta_bg_first_block_no() with
> the group paramter when the group is the first group of a meta_bg
> (e.g., when (group % EXT4_DESC_PER_BLOCK) is zero.  So we can simplify
> things a bit by removing ext4_meta_bg_first_block_no() and an open
> coding its logic.
> 
> Does this make more sense to tou?
> 
This patch tries to correct gdbblock calculation in add_new_gdb_meta_bg
in case group from caller is not the first group of meta_bg which is
supposed to be handled by add_new_gdb_meta_bg.
We should call ext4_bg_has_super with first group in meta_bg instead
of group which could be non first group in meta_bg to calculate gdb
of meta_bg.
Fortunately, the only caller ext4_add_new_descs always call
add_new_gdb_meta_bg with first group of meta_bg and no real issue
will happen.


> 					- Ted
> 


  reply	other threads:[~2023-08-17  3:39 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-29 12:00 [PATCH 00/13] fixes and cleanups to ext4 resize Kemeng Shi
2023-06-29 12:00 ` [PATCH 01/13] ext4: correct offset of gdb backup in non meta_bg group to update_backups Kemeng Shi
2023-08-16  3:03   ` Theodore Ts'o
2023-06-29 12:00 ` [PATCH 02/13] ext4: add missed brelse in update_backups Kemeng Shi
2023-08-16  3:03   ` Theodore Ts'o
2023-06-29 12:00 ` [PATCH 03/13] ext4: correct return value of ext4_convert_meta_bg Kemeng Shi
2023-08-16  3:00   ` Theodore Ts'o
2023-08-17  2:48     ` Kemeng Shi
2023-08-17 13:58       ` Theodore Ts'o
2023-06-29 12:00 ` [PATCH 04/13] ext4: remove gdb backup copy for meta bg in setup_new_flex_group_blocks Kemeng Shi
2023-08-16  3:10   ` Theodore Ts'o
2023-06-29 12:00 ` [PATCH 05/13] ext4: fix typo " Kemeng Shi
2023-08-16  3:10   ` Theodore Ts'o
2023-06-29 12:00 ` [PATCH 06/13] ext4: remove redundant check of count Kemeng Shi
2023-08-16  3:14   ` Theodore Ts'o
2023-06-29 12:00 ` [PATCH 07/13] ext4: remove commented code in reserve_backup_gdb Kemeng Shi
2023-08-16  3:14   ` Theodore Ts'o
2023-06-29 12:00 ` [PATCH 08/13] ext4: calculate free_clusters_count in cluster unit in verify_group_input Kemeng Shi
2023-08-16  3:22   ` Theodore Ts'o
2023-08-17  2:57     ` Kemeng Shi
2023-06-29 12:00 ` [PATCH 09/13] ext4: remove EXT4FS_DEBUG defination in resize.c Kemeng Shi
2023-08-16  3:23   ` Theodore Ts'o
2023-06-29 12:00 ` [PATCH 10/13] ext4: use saved local variable sbi instead of EXT4_SB(sb) Kemeng Shi
2023-08-16  3:24   ` Theodore Ts'o
2023-06-29 12:00 ` [PATCH 11/13] ext4: correct gdblock calculation in add_new_gdb_meta_bg to support non first group Kemeng Shi
2023-08-16  3:45   ` Theodore Ts'o
2023-08-17  3:38     ` Kemeng Shi [this message]
2023-08-17 14:03       ` Theodore Ts'o
2023-08-18  2:29         ` Kemeng Shi
2023-08-18  4:07           ` Theodore Ts'o
2023-08-18  7:09             ` Kemeng Shi
2023-08-18 16:54               ` Theodore Ts'o
2023-08-22  2:48                 ` Kemeng Shi
2023-06-29 12:00 ` [PATCH 12/13] ext4: remove unnecessary check for avoiding multiple update_backups in ext4_flex_group_add Kemeng Shi
2023-08-16  3:47   ` Theodore Ts'o
2023-08-17  3:53     ` Kemeng Shi
2023-08-17 14:11       ` Theodore Ts'o
2023-08-18  3:16         ` Kemeng Shi
2023-08-18  5:00           ` Theodore Ts'o
2023-08-18  8:42             ` Kemeng Shi
2023-08-18 16:00               ` Theodore Ts'o
2023-08-22  2:21                 ` Kemeng Shi
2023-06-29 12:00 ` [PATCH 13/13] ext4: remove unnecessary initialization of count2 in set_flexbg_block_bitmap Kemeng Shi
2023-08-16  3:48   ` 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=29c9e94f-63b3-e757-9d6d-c9beaa0e0c19@huaweicloud.com \
    --to=shikemeng@huaweicloud.com \
    --cc=adilger.kernel@dilger.ca \
    --cc=linux-ext4@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --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

all inboxes | Powered by JetHome®