qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] scsi: always call notifier on async cancellatio


From: Fam Zheng
Subject: Re: [Qemu-devel] [PATCH] scsi: always call notifier on async cancellation
Date: Thu, 17 Dec 2015 20:22:33 +0800
User-agent: Mutt/1.5.21 (2010-09-15)

On Thu, 12/17 09:41, Paolo Bonzini wrote:
> 
> 
> On 17/12/2015 02:15, Fam Zheng wrote:
> >> >      if (notifier) {
> >> >          notifier_list_add(&req->cancel_notifiers, notifier);
> >> >      }
> >> > -    if (req->io_canceled) {
> >> > -        return;
> >> > -    }
> >> >      scsi_req_ref(req);
> >> >      scsi_req_dequeue(req);
> >> >      req->io_canceled = true;
> >        if (req->aiocb) {
> >            blk_aio_cancel_async(req->aiocb);
> >        } else {
> >            scsi_req_cancel_complete(req);
> >        }
> > 
> > A second TMF must be blk_aio_cancel_async case, otherwise the first one 
> > would
> > have already completed the request synchronously in 
> > scsi_req_cancel_complete.
> 
> Good point.
> 
> > With that in mind, I think returning early is not a problem. But I suppose
> > these are also idempotent so this change is not breaking anything, either.
> 
> Right, the issue is that all these calls are idempotent, but the
> notifier may not; that is why I prefer to be safe and ensure that all
> notifier additions are matched by a notify.  But you explained well why
> this should be safe, I'll add a note to the commit message.
> 

Thanks, please add my

Reviewed-by: Fam Zheng <address@hidden>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]