mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andrew Kanner <andrew.kanner@gmail.com>
To: Joseph Qi <joseph.qi@linux.alibaba.com>
Cc: mark@fasheh.com, jlbec@evilplan.org, ocfs2-devel@lists.linux.dev,
	linux-kernel@vger.kernel.org,
	syzbot+386ce9e60fa1b18aac5b@syzkaller.appspotmail.com
Subject: Re: [PATCH] ocfs2: remove entry once instead of null-ptr-dereference in ocfs2_xa_remove()
Date: Sun, 3 Nov 2024 18:50:26 +0100	[thread overview]
Message-ID: <6727b7e0.170a0220.294c3c.d58a@mx.google.com> (raw)
In-Reply-To: <cfd351ed-01d5-42e6-a764-2d915bd3adeb@linux.alibaba.com>

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

      reply	other threads:[~2024-11-03 17:50 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-29 22:43 Andrew Kanner
2024-11-01 12:53 ` Joseph Qi
2024-11-03 17:50   ` Andrew Kanner [this message]

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=6727b7e0.170a0220.294c3c.d58a@mx.google.com \
    --to=andrew.kanner@gmail.com \
    --cc=jlbec@evilplan.org \
    --cc=joseph.qi@linux.alibaba.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark@fasheh.com \
    --cc=ocfs2-devel@lists.linux.dev \
    --cc=syzbot+386ce9e60fa1b18aac5b@syzkaller.appspotmail.com \
    /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

Powered by JetHome