[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <6727b7e0.170a0220.294c3c.d58a@mx.google.com>
Date: Sun, 3 Nov 2024 18:50:26 +0100
From: Andrew Kanner <andrew.kanner@...il.com>
To: Joseph Qi <joseph.qi@...ux.alibaba.com>
Cc: mark@...heh.com, jlbec@...lplan.org, ocfs2-devel@...ts.linux.dev,
linux-kernel@...r.kernel.org,
syzbot+386ce9e60fa1b18aac5b@...kaller.appspotmail.com
Subject: Re: [PATCH] ocfs2: remove entry once instead of null-ptr-dereference
in ocfs2_xa_remove()
On Fri, Nov 01, 2024 at 08:53:18PM +0800, Joseph Qi wrote:
> [...]
> > --- a/fs/ocfs2/xattr.c
> > +++ b/fs/ocfs2/xattr.c
> > @@ -2036,7 +2036,7 @@ static int ocfs2_xa_remove(struct ocfs2_xa_loc *loc,
> > rc = 0;
> > ocfs2_xa_cleanup_value_truncate(loc, "removing",
> > orig_clusters);
> > - if (rc)
> > + if (rc == 0)
>
> Seems in this case, we have to ignore rc and directly goto out?
>
> Thanks,
> Joseph
It looks so. After ocfs2_xa_value_truncate(loc, 0, ctxt) we might have
ocfs2_xa_value_clusters(loc) <= orig_clusters.
But we already do everything we should for '<' case in the following
ocfs2_xa_cleanup_value_truncate(). And probably should just return
error code for '=' case.
I'll send v2 with your suggestion. Thanks.
--
Andrew Kanner
Powered by blists - more mailing lists