Re: [PATCH 12/13] ext4: remove unnecessary check for avoiding multiple update_backups in ext4_flex_group_add
From: Theodore Ts'o
Date: Thu Aug 17 2023 - 10:12:13 EST
On Thu, Aug 17, 2023 at 11:53:52AM +0800, Kemeng Shi wrote:
>
>
> on 8/16/2023 11:47 AM, Theodore Ts'o wrote:
> > On Thu, Jun 29, 2023 at 08:00:43PM +0800, Kemeng Shi wrote:
> >> Commit 0acdb8876fead ("ext4: don't call update_backups() multiple times
> >> for the same bg") add check in ext4_flex_group_add to avoid call
> >> update_backups multiple times for block group descriptors in the same
> >> group descriptor block. However, we have already call update_backups in
> >> block step, so the added check is unnecessary.
> >
> > I'm having trouble understaind this comit. What do you mean by the
> > "block step" in the last paragraph?
> >
> Sorry for the confusing stuff. I mean we foreach in group descriptor block
> step instead of foreach in group descriptor step to update backup.
> So there is no chance to call update_backups for different descriptors
> in the same bg.
I'm still confused. This commit is not so much removing an
unnecessary check as much as forcing update_backups() to be called for
every single block group. Right?
So either we're doing extra work, or (b) we're fixing a problem
because we actually *need* to call update_backups() for every single
block group.
More generally, this whole patch series is making it clear that the
online resize code is hard to understand, because it's super
complicated, leading to potential bugs, and very clearly code which is
very hard to maintain. So this may mean we need better comments to
make it clear *when* the backup block groups are going to be
accomplished, given the various different cases (e.g., no flex_bg or
meta_bg, with flex_bg, or with meat_bg).
- Ted