linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Li Li <dualli@chromium.org>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: "Li Li" <dualli@google.com>, "Todd Kjos" <tkjos@google.com>,
	"Greg KH" <gregkh@linuxfoundation.org>,
	"Christian Brauner" <christian@brauner.io>,
	"Arve Hjønnevåg" <arve@android.com>,
	"open list:ANDROID DRIVERS" <devel@driverdev.osuosl.org>,
	LKML <linux-kernel@vger.kernel.org>,
	"Martijn Coenen" <maco@google.com>,
	"Hridya Valsaraju" <hridya@google.com>,
	"Suren Baghdasaryan" <surenb@google.com>,
	"Joel Fernandes (Google)" <joel@joelfernandes.org>,
	"Android Kernel Team" <kernel-team@android.com>
Subject: Re: [PATCH v1 1/1] binder: fix freeze race
Date: Fri, 10 Sep 2021 00:04:35 -0700	[thread overview]
Message-ID: <CANBPYPgCUgjpX38dNR+SyPVBUTF_go0saTmitO_z+Ox3AgkCdg@mail.gmail.com> (raw)
In-Reply-To: <20210910060251.GC7203@kadam>

On Thu, Sep 9, 2021 at 11:03 PM Dan Carpenter <dan.carpenter@oracle.com> wrote:
>
> On Thu, Sep 09, 2021 at 04:21:41PM -0700, Li Li wrote:
> > @@ -4648,6 +4647,22 @@ static int binder_ioctl_get_node_debug_info(struct binder_proc *proc,
> >       return 0;
> >  }
> >
> > +static int binder_txns_pending(struct binder_proc *proc)
> > +{
> > +     struct rb_node *n;
> > +     struct binder_thread *thread;
> > +
> > +     if (proc->outstanding_txns > 0)
> > +             return 1;
>
> Make this function bool.

Will include the change (as well as the extra ->outstanding_txns
check) in the next revision.
>
> > +
> > +     for (n = rb_first(&proc->threads); n; n = rb_next(n)) {
> > +             thread = rb_entry(n, struct binder_thread, rb_node);
> > +             if (thread->transaction_stack)
> > +                     return 1;
> > +     }
> > +     return 0;
> > +}
> > +
> >  static int binder_ioctl_freeze(struct binder_freeze_info *info,
> >                              struct binder_proc *target_proc)
> >  {
> > @@ -4682,6 +4697,14 @@ static int binder_ioctl_freeze(struct binder_freeze_info *info,
> >       if (!ret && target_proc->outstanding_txns)
> >               ret = -EAGAIN;
>
> These two lines can be deleted now because binder_txns_pending() checks
> ->outstanding_txns.
>

Thanks,
Li

      reply	other threads:[~2021-09-10  7:05 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-09 23:21 [PATCH v1 0/1] binder: fix freeze race Li Li
2021-09-09 23:21 ` [PATCH v1 1/1] " Li Li
2021-09-09 23:54   ` Todd Kjos
2021-09-10  3:32     ` Li Li
2021-09-10  6:02   ` Dan Carpenter
2021-09-10  7:04     ` Li Li [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=CANBPYPgCUgjpX38dNR+SyPVBUTF_go0saTmitO_z+Ox3AgkCdg@mail.gmail.com \
    --to=dualli@chromium.org \
    --cc=arve@android.com \
    --cc=christian@brauner.io \
    --cc=dan.carpenter@oracle.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=dualli@google.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=hridya@google.com \
    --cc=joel@joelfernandes.org \
    --cc=kernel-team@android.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maco@google.com \
    --cc=surenb@google.com \
    --cc=tkjos@google.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;
as well as URLs for NNTP newsgroup(s).