At this point, vs_tpg is not public at all; tv_tpg_vhost_count is accessed under tpg->tv_tpg_mutex; tpg->vhost_scsi is accessed under vhost_scsi_mutex. Therefor there are no atomic operations involved at all here, just remove the barrier. Reported-by: Andrea Parri <andrea.parri at amarulasolutions.com> Signed-off-by: Paolo Bonzini <pbonzini at redhat.com> --- drivers/vhost/scsi.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/vhost/scsi.c b/drivers/vhost/scsi.c index 618fb6461017..c090d177bd75 100644 --- a/drivers/vhost/scsi.c +++ b/drivers/vhost/scsi.c @@ -1443,7 +1443,6 @@ static void vhost_scsi_flush(struct vhost_scsi *vs) tpg->tv_tpg_vhost_count++; tpg->vhost_scsi = vs; vs_tpg[tpg->tport_tpgt] = tpg; - smp_mb__after_atomic(); match = true; } mutex_unlock(&tpg->tv_tpg_mutex); -- 1.8.3.1
On 2019/4/16 ??4:56, Paolo Bonzini wrote:> At this point, vs_tpg is not public at all; tv_tpg_vhost_count > is accessed under tpg->tv_tpg_mutex; tpg->vhost_scsi is > accessed under vhost_scsi_mutex. Therefor there are no atomic > operations involved at all here, just remove the barrier. > > Reported-by: Andrea Parri <andrea.parri at amarulasolutions.com> > Signed-off-by: Paolo Bonzini <pbonzini at redhat.com> > --- > drivers/vhost/scsi.c | 1 - > 1 file changed, 1 deletion(-) > > diff --git a/drivers/vhost/scsi.c b/drivers/vhost/scsi.c > index 618fb6461017..c090d177bd75 100644 > --- a/drivers/vhost/scsi.c > +++ b/drivers/vhost/scsi.c > @@ -1443,7 +1443,6 @@ static void vhost_scsi_flush(struct vhost_scsi *vs) > tpg->tv_tpg_vhost_count++; > tpg->vhost_scsi = vs; > vs_tpg[tpg->tport_tpgt] = tpg; > - smp_mb__after_atomic(); > match = true; > } > mutex_unlock(&tpg->tv_tpg_mutex);Acked-by: Jason Wang <jasowang at redhat.com>
Apparently Analagous Threads
- [PATCH] vhost/scsi: drop unnecessary smp_mb__after_atomic()
- [PATCH] vhost/scsi: drop unnecessary smp_mb__after_atomic()
- [PATCH] vhost/scsi: drop unnecessary smp_mb__after_atomic()
- [PATCH v2 0/7] vhost-scsi: Fix crashes and management op hangs
- [PATCH 3/5] vhost-scsi: Remove vhost_scsi_mutex from port link/unlink