Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp272506ybe; Thu, 5 Sep 2019 22:13:04 -0700 (PDT) X-Google-Smtp-Source: APXvYqw47gFlW4P3IyDPIgJJGg8VZnGFoptCZtvVWLLwVibcGkLIIR77mYqMigw0pvqyLj1uw/Jy X-Received: by 2002:a17:90a:9f05:: with SMTP id n5mr7674736pjp.103.1567746783940; Thu, 05 Sep 2019 22:13:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567746783; cv=none; d=google.com; s=arc-20160816; b=PKRnmHQEUxSI27frMYX8AYE+uwqRWtc7QJ+lHRNNQ4TB9fqT72ZrbnVE3WezHV+tvE aXV3gIDN1TrMdHY5cGQopkrYkZJNt8nld8TJFpttrdwCQaef5TrD1dFBIwEEKqFAs2Ts CBjc+iTKQGeJzK92OA4hlRaNhad8BKZVz9t8vxCwKhjbmrEG6BsFAzBpeEztZ1qYNFQZ tI75iCt8er8o8qMHzpWlrirptyUIOpWzidLPLMCMVEQSHIfMB0Qc8kPPhTUYIlFCPDTa YLHwUagmxO21kPEvo7tGHbaqAW2PBCGqL/iNgIFjOM2pK7Z1qvzCHqfC95KkTGpmG53g jzPA== 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=+Ieawjp2hydw017vPZNk7KxZJn+fqB2ZK/dQLhfYbZw=; b=aW6g+HddIF0l+sDPVUI+Dj9rul7p/OQoIXVTlPns1+vKXUTFYHuU3GTHwxJqE9hEQf BdidAnTgkO2AiPq0/59fue9+qG/D7CkTSHmm6oyEOHEb4Kvmy/K5OtYqP4zCfVVMdI51 db1os6N7CCw90Sc+FrXfkLZAtIJygmzIo6yXLGRHsdBsDbHXQt089eN3z2iGKFoBil/h goq04DofHMsFpqZMBaw3sMjv3nAEDIlqohgnPBLDb18aeQbWJQNjPsjeqmsinjhDw0y0 8tV230PRySJBLGrg/yw+thY8F7QJ8Tie0bBCd3XiSM1N78U1c6ZfcU8Y06w/wdM8bvnh JDRg== 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 g13si3606601pgo.274.2019.09.05.22.12.48; Thu, 05 Sep 2019 22:13:03 -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 S2391518AbfIETuX (ORCPT + 99 others); Thu, 5 Sep 2019 15:50:23 -0400 Received: from mx1.redhat.com ([209.132.183.28]:60334 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388067AbfIETt1 (ORCPT ); Thu, 5 Sep 2019 15:49:27 -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 E1282308FC20; Thu, 5 Sep 2019 19:49:26 +0000 (UTC) Received: from horse.redhat.com (unknown [10.18.25.137]) by smtp.corp.redhat.com (Postfix) with ESMTP id BBF88600F8; Thu, 5 Sep 2019 19:49:26 +0000 (UTC) Received: by horse.redhat.com (Postfix, from userid 10451) id 08BE92253A3; Thu, 5 Sep 2019 15:49:18 -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 11/18] virtiofs: stop and drain queues after sending DESTROY Date: Thu, 5 Sep 2019 15:48:52 -0400 Message-Id: <20190905194859.16219-12-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.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.43]); 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 During virtio_kill_sb() we first stop forget queue and drain it and then call fuse_kill_sb_anon(). This will result in sending DESTROY request to fuse server. Once finished, stop all the queues and drain one more time just to be sure and then free up the devices. Given drain queues will call flush_work() on various workers, remove this logic from virtio_free_devs(). Signed-off-by: Vivek Goyal --- fs/fuse/virtio_fs.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/fs/fuse/virtio_fs.c b/fs/fuse/virtio_fs.c index 1ea0f889e804..a76bd5a04521 100644 --- a/fs/fuse/virtio_fs.c +++ b/fs/fuse/virtio_fs.c @@ -180,9 +180,6 @@ static void virtio_fs_free_devs(struct virtio_fs *fs) if (!fsvq->fud) continue; - flush_work(&fsvq->done_work); - flush_delayed_work(&fsvq->dispatch_work); - /* TODO need to quiesce/end_requests/decrement dev_count */ fuse_dev_free(fsvq->fud); fsvq->fud = NULL; @@ -994,6 +991,8 @@ static int virtio_fs_fill_super(struct super_block *sb) atomic_inc(&fc->dev_count); } + /* Previous unmount will stop all queues. Start these again */ + virtio_fs_start_all_queues(fs); fuse_send_init(fc, init_req); return 0; @@ -1026,6 +1025,12 @@ static void virtio_kill_sb(struct super_block *sb) virtio_fs_drain_all_queues(vfs); fuse_kill_sb_anon(sb); + + /* fuse_kill_sb_anon() must have sent destroy. Stop all queues + * and drain one more time and free fuse devices. + */ + virtio_fs_stop_all_queues(vfs); + virtio_fs_drain_all_queues(vfs); virtio_fs_free_devs(vfs); } -- 2.20.1