Re: [PATCH] ocfs2: validate group add input before caching

From: ZhengYuan Huang

Date: Thu Apr 09 2026 - 11:42:45 EST


On Thu, Apr 9, 2026 at 9:05 PM Joseph Qi <joseph.qi@xxxxxxxxxxxxxxxxx> wrote:
> Missing Fixes tag:
> Fixes: 7909f2bf8353 ("[PATCH 2/2] ocfs2: Implement group add for online resize")
>
> > ---
> > fs/ocfs2/resize.c | 6 +++---
> > 1 file changed, 3 insertions(+), 3 deletions(-)
> >
> > diff --git a/fs/ocfs2/resize.c b/fs/ocfs2/resize.c
> > index b0733c08ed13..e45ab5592ee0 100644
> > --- a/fs/ocfs2/resize.c
> > +++ b/fs/ocfs2/resize.c
> > @@ -504,14 +504,14 @@ int ocfs2_group_add(struct inode *inode, struct ocfs2_new_group_input *input)
> > goto out_unlock;
> > }
> >
> > - ocfs2_set_new_buffer_uptodate(INODE_CACHE(inode), group_bh);
> > -
> > ret = ocfs2_verify_group_and_input(main_bm_inode, fe, input, group_bh);
> > if (ret) {
> > mlog_errno(ret);
> > goto out_free_group_bh;
> > }
>
> Since ocfs2_set_new_buffer_uptodate is now moved down, the error goto
> above should also be changed.
>
> e.g. do the same ioctl twice, the second will remove the cache which
> should be valid. This is not the expected behavior.
>
> Thanks,
> Joseph

Thanks for pointing this out.

The issue is valid, and I’ve addressed it in v2 by fixing the error
path accordingly.
v2 patch has been sent.

Thanks,
ZhengYuan Huang