[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CANBPYPgCUgjpX38dNR+SyPVBUTF_go0saTmitO_z+Ox3AgkCdg@mail.gmail.com>
Date: Fri, 10 Sep 2021 00:04:35 -0700
From: Li Li <dualli@...omium.org>
To: Dan Carpenter <dan.carpenter@...cle.com>
Cc: Li Li <dualli@...gle.com>, Todd Kjos <tkjos@...gle.com>,
Greg KH <gregkh@...uxfoundation.org>,
Christian Brauner <christian@...uner.io>,
Arve Hjønnevåg <arve@...roid.com>,
"open list:ANDROID DRIVERS" <devel@...verdev.osuosl.org>,
LKML <linux-kernel@...r.kernel.org>,
Martijn Coenen <maco@...gle.com>,
Hridya Valsaraju <hridya@...gle.com>,
Suren Baghdasaryan <surenb@...gle.com>,
"Joel Fernandes (Google)" <joel@...lfernandes.org>,
Android Kernel Team <kernel-team@...roid.com>
Subject: Re: [PATCH v1 1/1] binder: fix freeze race
On Thu, Sep 9, 2021 at 11:03 PM Dan Carpenter <dan.carpenter@...cle.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
Powered by blists - more mailing lists