[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: [PATCH 4/4] block/iscsi.c: Use lock guard macros
From: |
ganqixin |
Subject: |
RE: [PATCH 4/4] block/iscsi.c: Use lock guard macros |
Date: |
Thu, 3 Dec 2020 07:04:22 +0000 |
> -----Original Message-----
> From: Kevin Wolf [mailto:kwolf@redhat.com]
> Sent: Wednesday, December 2, 2020 7:12 PM
> To: ganqixin <ganqixin@huawei.com>
> Cc: qemu-devel@nongnu.org; qemu-trivial@nongnu.org;
> pbonzini@redhat.com; mreitz@redhat.com; stefanha@redhat.com;
> dnbrdsky@gmail.com; Zhanghailiang <zhang.zhanghailiang@huawei.com>;
> Chenqun (kuhn) <kuhn.chenqun@huawei.com>
> Subject: Re: [PATCH 4/4] block/iscsi.c: Use lock guard macros
>
> Am 09.11.2020 um 16:43 hat Gan Qixin geschrieben:
> > Replace manual lock()/unlock() calls with lock guard macros
> > (QEMU_LOCK_GUARD/WITH_QEMU_LOCK_GUARD) in block/iscsi.c.
> >
> > Signed-off-by: Gan Qixin <ganqixin@huawei.com>
> > ---
> > block/iscsi.c | 28 +++++++++++++---------------
> > 1 file changed, 13 insertions(+), 15 deletions(-)
> >
> > diff --git a/block/iscsi.c b/block/iscsi.c index
> > e30a7e3606..f5f657b582 100644
> > --- a/block/iscsi.c
> > +++ b/block/iscsi.c
> > @@ -322,7 +322,7 @@ iscsi_aio_cancel(BlockAIOCB *blockacb)
> > IscsiAIOCB *acb = (IscsiAIOCB *)blockacb;
> > IscsiLun *iscsilun = acb->iscsilun;
> >
> > - qemu_mutex_lock(&iscsilun->mutex);
> > + QEMU_LOCK_GUARD(&iscsilun->mutex);
> >
> > /* If it was cancelled or completed already, our work is done here */
> > if (acb->cancelled || acb->status != -EINPROGRESS) {
> qemu_mutex_unlock(&iscsilun->mutex);
> return;
> }
>
> I don't think this qemu_mutex_unlock() is right any more now.
You are right, I ignored this qemu_mutex_unlock(). I will correct it and
resubmit. :)
Thanks,
Gan Qixin
>
> Kevin