Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp1456537ybe; Thu, 5 Sep 2019 16:03:44 -0700 (PDT) X-Google-Smtp-Source: APXvYqxpxhiqW5r67eDZRcNgLjV0fD3tgUM0TqKp+IYUIvtNLTt9tJpeVqcPLYaYZQq22vt8K2wM X-Received: by 2002:a65:6097:: with SMTP id t23mr5341991pgu.357.1567724624400; Thu, 05 Sep 2019 16:03:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567724624; cv=none; d=google.com; s=arc-20160816; b=EuX1gvUTpIlH90yHZQcrrvKBiJdiJagG1WVWKjtd2yJgOdxcrTu7N0zCiP1t9OoJ3Q bqzzZvBEuOtk5VsGEQzI6Kh73VqEEE5lySb/THLrRjrdlfqjE4mxhkcNQ2A+mArrDuQz +v5G4wK3kYW2t/GC5/aVk9SQ954oDRR4DG2rWe2Isbwzqr1zE4MAsGKLQ8OYuBRfWlSy N9ZSbTSH7V0o00+rDjM0GbHVTpHRiz3HXEDGgMLIrRUOUJLdQPlf326YE42wTZj9YZBw Zei6lc+qxeMdcENa9ei1S6RegEi0Jq0oJVmL0my/gbxWY7WyeRWzUH/VBbYD4/QZT46X H24w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=D7/Qxhx+14ZAOmHkN1GD29W8wxsHebfIR9lWKf8t7Ss=; b=c0WzmgJucMnJJcrBAg+9EaivmGPlgWVTeTjs9oQP4pKvXxc8p4hpw/C3LqJq69D2Y6 RQi73WgCcD9lNMqHj+xYyJUxXbn+LQYskypL+h2R852bqweLRf8wkzU9uB72XSKW9L+0 AOI4y9Vsm6soIFVqW1LW9W/2xVQJthGGFa/uoc7e6fvDmaKukEBQYotumnfA1PiFC9ZW 2pHXI3+s+uAErnasJKvsEZFL66/EcDBhCNG0pDeauxuLXxxDuyOGgfDD6R5fqVS4nJWH t71hzCTPP3NAnbtEA5Av2E48q7+yG9xHlNMWeScD6dl4ulZvzf8bBudtphbH2f9lM0n3 x8Ug== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o7si3038725pgq.459.2019.09.05.16.03.28; Thu, 05 Sep 2019 16:03:44 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732766AbfIETt0 (ORCPT + 99 others); Thu, 5 Sep 2019 15:49:26 -0400 Received: from mx1.redhat.com ([209.132.183.28]:59138 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732060AbfIETt0 (ORCPT ); Thu, 5 Sep 2019 15:49:26 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id ED7973082DDD; Thu, 5 Sep 2019 19:49:25 +0000 (UTC) Received: from horse.redhat.com (unknown [10.18.25.137]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3DAFA5C1D4; Thu, 5 Sep 2019 19:49:18 +0000 (UTC) Received: by horse.redhat.com (Postfix, from userid 10451) id C154F22539A; Thu, 5 Sep 2019 15:49:17 -0400 (EDT) From: Vivek Goyal To: linux-fsdevel@vger.kernel.org, virtualization@lists.linux-foundation.org, miklos@szeredi.hu Cc: linux-kernel@vger.kernel.org, virtio-fs@redhat.com, vgoyal@redhat.com, stefanha@redhat.com, dgilbert@redhat.com, mst@redhat.com Subject: [PATCH 02/18] virtiofs: Check whether hiprio queue is connected at submission time Date: Thu, 5 Sep 2019 15:48:43 -0400 Message-Id: <20190905194859.16219-3-vgoyal@redhat.com> In-Reply-To: <20190905194859.16219-1-vgoyal@redhat.com> References: <20190905194859.16219-1-vgoyal@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.46]); Thu, 05 Sep 2019 19:49:26 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org For hiprio queue (forget requests), we are keeping a state in queue whether queue is connected or not. If queue is not connected, do not try to submit request and return error instead. As of now, we are checking for this state only in path where worker tries to submit forget after first attempt failed. Check this state even in the path when request is being submitted first time. Signed-off-by: Vivek Goyal --- fs/fuse/virtio_fs.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/fs/fuse/virtio_fs.c b/fs/fuse/virtio_fs.c index a708ccb65662..e9497b565dd8 100644 --- a/fs/fuse/virtio_fs.c +++ b/fs/fuse/virtio_fs.c @@ -577,9 +577,16 @@ __releases(fiq->waitq.lock) sg_init_one(&sg, forget, sizeof(*forget)); /* Enqueue the request */ + spin_lock(&fsvq->lock); + + if (!fsvq->connected) { + kfree(forget); + spin_unlock(&fsvq->lock); + goto out; + } + vq = fsvq->vq; dev_dbg(&vq->vdev->dev, "%s\n", __func__); - spin_lock(&fsvq->lock); ret = virtqueue_add_sgs(vq, sgs, 1, 0, forget, GFP_ATOMIC); if (ret < 0) { -- 2.20.1