Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp273670ybe; Thu, 5 Sep 2019 22:14:42 -0700 (PDT) X-Google-Smtp-Source: APXvYqx//cEzhW4rLC4SNGRLZ8LqGRu0ImRbIgN5gbU3IvMI3dQcEIdsFDaaYDLO2UhwIHA3w2YH X-Received: by 2002:a17:90a:a4c3:: with SMTP id l3mr7933315pjw.46.1567746882353; Thu, 05 Sep 2019 22:14:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567746882; cv=none; d=google.com; s=arc-20160816; b=Z/HCO/3xxXfllZilnLUmiKa3/mtfdrlbvNpcFyBbWN+dOGz0yiJC0tTPB7Acy79w8E MGrRn1VBupclnfUvs2yY7z5vqITRPDgQyh2ooViwLvRVWWqQFN4ItMWs7hqRBH809qib KLaU7I3gCh/qMioXhKAshCg1y8TGRYEu6DG7jduOIHCAPWjw7n8ubpY40IDLVzy38T+B /T9z7QWTWF/jGc2wH2VQs2W/495s9djc2yOlZ/FGNimC3LIBp3WS/LnOAwS1YXZK6G4V WX50v/1hUj0AzLPb4uQTpEtfhpkO1yUJQM0kyjqYZN77Xc1oMe14Y9NzX68pCR1wkGUr yS3Q== 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 :message-id:date:subject:cc:to:from; bh=+GMKifiIC9HrrVnel41IxMs7V+mmDdY70w6aRlgAAac=; b=DVcAmXPbGHM/t1F8F8SR2FVpOuKtSpiCm2sPHBbd3ZVW69L9FG8424f6IrBe8PpEMY Sv/63eBXBd2hlRy87L7IKEQv/dhfBnjzJwLRH7JEtktisiID4KDk/7xQfKj1SrJBIfsH JwagSqa/ofFVXgA0Wtjku2rUL0oob16CXGunxiwMFCUkwC/C3gxqF2YJKvcD0F5o1DkX vEIJI4JwILWYhu+/8DE1xc5mGKPg5I774WH+qaVZUFlH2phCKZ9A5/UL1M9MWRcQnvi8 oT5rRypHHQ4fypAUiYjBNidwBjHAM6RtrvM80eh4NUndjbj2rXWnaSl4cybwIODcgnbY bc9g== 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 j126si4640377pfb.226.2019.09.05.22.14.26; Thu, 05 Sep 2019 22:14:42 -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 S2404005AbfIETu5 (ORCPT + 99 others); Thu, 5 Sep 2019 15:50:57 -0400 Received: from mx1.redhat.com ([209.132.183.28]:55848 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732081AbfIETt0 (ORCPT ); Thu, 5 Sep 2019 15:49:26 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id EDE0A883823; 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 3D6B46012D; Thu, 5 Sep 2019 19:49:18 +0000 (UTC) Received: by horse.redhat.com (Postfix, from userid 10451) id B6929220292; 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 00/18] virtiofs: Fix various races and cleanups round 1 Date: Thu, 5 Sep 2019 15:48:41 -0400 Message-Id: <20190905194859.16219-1-vgoyal@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.6.2 (mx1.redhat.com [10.5.110.69]); 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 Hi, Michael Tsirkin pointed out issues w.r.t various locking related TODO items and races w.r.t device removal. In this first round of cleanups, I have taken care of most pressing issues. These patches apply on top of following. git://git.kernel.org/pub/scm/linux/kernel/git/mszeredi/fuse.git#virtiofs-v4 I have tested these patches with mount/umount and device removal using qemu monitor. For example. virsh qemu-monitor-command --hmp vm9-f28 device_del myvirtiofs Now a mounted device can be removed and file system will return errors -ENOTCONN and one can unmount it. Miklos, if you are fine with the patches, I am fine if you fold these all into existing patch. I kept them separate so that review is easier. Any feedback or comments are welcome. Thanks Vivek Vivek Goyal (18): virtiofs: Remove request from processing list before calling end virtiofs: Check whether hiprio queue is connected at submission time virtiofs: Pass fsvq instead of vq as parameter to virtio_fs_enqueue_req virtiofs: Check connected state for VQ_REQUEST queue as well Maintain count of in flight requests for VQ_REQUEST queue virtiofs: ->remove should not clean virtiofs fuse devices virtiofs: Stop virtiofs queues when device is being removed virtiofs: Drain all pending requests during ->remove time virtiofs: Add an helper to start all the queues virtiofs: Do not use device managed mem for virtio_fs and virtio_fs_vq virtiofs: stop and drain queues after sending DESTROY virtiofs: Use virtio_fs_free_devs() in error path virtiofs: Do not access virtqueue in request submission path virtiofs: Add a fuse_iqueue operation to put() reference virtiofs: Make virtio_fs object refcounted virtiofs: Use virtio_fs_mutex for races w.r.t ->remove and mount path virtiofs: Remove TODO to quiesce/end_requests virtiofs: Remove TODO item from virtio_fs_free_devs() fs/fuse/fuse_i.h | 5 + fs/fuse/inode.c | 6 + fs/fuse/virtio_fs.c | 259 ++++++++++++++++++++++++++++++++------------ 3 files changed, 198 insertions(+), 72 deletions(-) -- 2.20.1