From patchwork Tue Apr 16 10:47:48 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Hajnoczi X-Patchwork-Id: 10902691 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D9F601669 for ; Tue, 16 Apr 2019 10:48:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C1A5C289B9 for ; Tue, 16 Apr 2019 10:48:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B5EC3289BE; Tue, 16 Apr 2019 10:48:06 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AD680289B9 for ; Tue, 16 Apr 2019 10:48:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728895AbfDPKr6 (ORCPT ); Tue, 16 Apr 2019 06:47:58 -0400 Received: from mx1.redhat.com ([209.132.183.28]:53396 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726347AbfDPKr6 (ORCPT ); Tue, 16 Apr 2019 06:47:58 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id B531A368B3; Tue, 16 Apr 2019 10:47:56 +0000 (UTC) Received: from localhost (ovpn-117-202.ams2.redhat.com [10.36.117.202]) by smtp.corp.redhat.com (Postfix) with ESMTP id DD1901001E8C; Tue, 16 Apr 2019 10:47:49 +0000 (UTC) From: Stefan Hajnoczi To: kvm@vger.kernel.org Cc: virtualization@lists.linux-foundation.org, linux-kernel@vger.kernel.org, "Michael S. Tsirkin" , Nicholas Bellinger , Andrea Parri , Jason Wang , Stefan Hajnoczi Subject: [PATCH] vhost/scsi: drop unnecessary smp_mb__after_atomic() Date: Tue, 16 Apr 2019 11:47:48 +0100 Message-Id: <20190416104748.26942-1-stefanha@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Tue, 16 Apr 2019 10:47:58 +0000 (UTC) Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The vhost_scsi.ko code used several atomic variables at one point. Later they were dropped or converted to regular ints protected by a mutex. The commit that made these changes left an unused smp_mb__after_atomic() in vhost_scsi_set_endpoint(). It was previously used after incrementing vhost_scsi->vhost_ref_cnt but this field has been dropped: - atomic_inc(&vs->vhost_ref_cnt); smp_mb__after_atomic_inc(); Reported-by: Andrea Parri Fixes: 101998f6fcd680 ("tcm_vhost: Post-merge review changes requested by MST") Signed-off-by: Stefan Hajnoczi --- 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 @@ vhost_scsi_set_endpoint(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);