Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp3651654ioo; Mon, 30 May 2022 06:53:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx9roinRVKjb4YvuGUi/S90YuG3BeVCfyc4kV2flQigjyFNnoUasHzNeJrwoBoJvKAaWI0F X-Received: by 2002:a17:906:9b8f:b0:6ff:f3c:814d with SMTP id dd15-20020a1709069b8f00b006ff0f3c814dmr24389297ejc.381.1653918793090; Mon, 30 May 2022 06:53:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653918793; cv=none; d=google.com; s=arc-20160816; b=st2IN9/Dh6TLgaWAJqXyaQfRUd+5TvVTjIqDuD6GejwFUXfghQDYYJCmsNi/yr8ww8 zuV+gIBDkjv9v/g6Vo8eIZ8CI4lSvnCcg4s8UldIBmXNJsdD63M8Lf2KPRZvIL41nNJt gTJeAF9ZfFZfHiGts9a7BnzXvYTSazrSf4P5+xHdPTsoeVVQZL6S2GvnVsTozddkfAyT hS5Y1SJwa2MjMpKbWNCmjjbXqZQ9j6URT4pp+5XqH0iRlFfpemLkp8c4QK2EJI6iEwp0 LUBbNNdZOfjT6F/xIf9asYSYP/H1EUWHspBRmIyLtYj4QYJpgl6v+DdloRDWP0nNUUGy uXIw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=H7unC4ownPzSgIneOEus8VvlbiKaGr/5bsj+MLLARkw=; b=kZ08E3XN0fFMpmLRvIZnsyrUp7Fz4Z7mVm2Ro962oe8CoDp60nhFmfJSN7r5y3RF2W HIr3ZDtpPAUZ/6z64eBHwnCrQ5ErTGE9zN9Y0ooAfog9PuE2muSfr4TA1hQ3ycQ6tAqr DkK7RwVOjWB0xYhpMZnTPR+YDacdIM5HcNomOewID+S6pBAPuluI13jWQCVwZBv+35vC n4eRtQB5TTE4bjUakjHQXS45Pi5mfU63pKh+BBjqUNkG5vCvPXKzfoDfCg+sBVBkF4uC eFgmGrqBAesED18rLFmO2hVhNLrJro45sg8b4+eF0AuSrvLJ1jIantC2jpa6JWoKkCFy HuFA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=F+jcLhmM; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h10-20020a05640250ca00b0042aada93f99si10683815edb.317.2022.05.30.06.52.39; Mon, 30 May 2022 06:53:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=F+jcLhmM; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232126AbiE3Bkv (ORCPT + 99 others); Sun, 29 May 2022 21:40:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52172 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232113AbiE3Bkq (ORCPT ); Sun, 29 May 2022 21:40:46 -0400 Received: from mail-pg1-x531.google.com (mail-pg1-x531.google.com [IPv6:2607:f8b0:4864:20::531]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2849F3EB9B for ; Sun, 29 May 2022 18:40:46 -0700 (PDT) Received: by mail-pg1-x531.google.com with SMTP id g184so8907471pgc.1 for ; Sun, 29 May 2022 18:40:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=H7unC4ownPzSgIneOEus8VvlbiKaGr/5bsj+MLLARkw=; b=F+jcLhmMa1fdNwt934xZxIvqAZrp3oqK6FasgDl2yEX4zP18/6i2Z/r029sARrDkqm vzey0c9a2KdCguchIJnmk1FllnQMQgZosbAgpXnndjFotR0925XK3aMpsw3xKoLjdyut 7jE5WSGjBeFo7Fi4+ULEMHNBxbHfmj04GS9Bs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=H7unC4ownPzSgIneOEus8VvlbiKaGr/5bsj+MLLARkw=; b=U1ajdoicqhbfqQAljqjNjQ3+JE1Kh0ICHpMqSpeL84CH6UmynmEAJZfJC3+1nH4ml7 bBzwAQT/rYR0skYMetgAhPWUPJbHEPXRNb08LH0HZavvdA68E09Bqf4hqCnOp2pwgucM tdcWeSbKxpl0xtwY142C84OyMYyIA50Z8T93mQiauEamF675Xm5DcnM+vh+qoB2AmpQy UqSYnu26Vky7ygeuK+E4GwlSxieh4tURQeXCC+JRJzfERnaYsrsgxxG6LU+SrcUHKUKL o5UtKzEqJw7+5rOJ7GXPXM8ATx0A+H5dyFPCi11L2B3ZB80m0NwaA8ZKg8GiIePF8sq4 v8uA== X-Gm-Message-State: AOAM530B/AtUJUagJgwkhhhrWptDUkcQl6USqv5v7+f93+wAX0PpA6Q6 K1YvggpsYX7k1ez60Ojt9L0W3g== X-Received: by 2002:a65:668b:0:b0:3f6:4026:97cd with SMTP id b11-20020a65668b000000b003f6402697cdmr44684419pgw.420.1653874845626; Sun, 29 May 2022 18:40:45 -0700 (PDT) Received: from dlunevwfh.roam.corp.google.com (n122-107-196-14.sbr2.nsw.optusnet.com.au. [122.107.196.14]) by smtp.gmail.com with ESMTPSA id l9-20020a170902eb0900b0015f2d549b46sm662285plb.237.2022.05.29.18.40.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 29 May 2022 18:40:45 -0700 (PDT) From: Daniil Lunev To: linux-fsdevel@vger.kernel.org, miklos@szeredi.hu, viro@zeniv.linux.org.uk, hch@infradead.org, tytso@mit.edu Cc: fuse-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org, Daniil Lunev Subject: [PATCH v3 2/2] FUSE: Retire superblock on force unmount Date: Mon, 30 May 2022 11:39:58 +1000 Message-Id: <20220530113953.v3.2.I692165059274c30b59bed56940b54a573ccb46e4@changeid> X-Mailer: git-send-email 2.31.0 In-Reply-To: <20220530013958.577941-1-dlunev@chromium.org> References: <20220530013958.577941-1-dlunev@chromium.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.9 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Force unmount of FUSE severes the connection with the user space, even if there are still open files. Subsequent remount tries to re-use the superblock held by the open files, which is meaningless in the FUSE case after disconnect - reused super block doesn't have userspace counterpart attached to it and is incapable of doing any IO. Signed-off-by: Daniil Lunev --- Changes in v3: - No changes Changes in v2: - Use an exported function instead of directly modifying superblock fs/fuse/inode.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/fs/fuse/inode.c b/fs/fuse/inode.c index 8c0665c5dff88..8875361544b2a 100644 --- a/fs/fuse/inode.c +++ b/fs/fuse/inode.c @@ -476,8 +476,11 @@ static void fuse_umount_begin(struct super_block *sb) { struct fuse_conn *fc = get_fuse_conn_super(sb); - if (!fc->no_force_umount) - fuse_abort_conn(fc); + if (fc->no_force_umount) + return; + + fuse_abort_conn(fc); + retire_super(sb); } static void fuse_send_destroy(struct fuse_mount *fm) -- 2.31.0