Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp3369716ioo; Sun, 29 May 2022 23:48:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy/CNTXUz+UZ4/JagpZ+ccVBc6N2AVX4Gzs1rWXcGY7hjSloQzOC/ZhiSGnubP4mL5QnffL X-Received: by 2002:a17:906:9d90:b0:6fe:b875:171e with SMTP id fq16-20020a1709069d9000b006feb875171emr39979435ejc.517.1653893285906; Sun, 29 May 2022 23:48:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653893285; cv=none; d=google.com; s=arc-20160816; b=TKV9vTalH6OlEv/xGdgDVu/fqA2S2bK/8mQiEoyFG9ojuS/U8kwAawhVjm76+2fnHP JzK9byahVgLGX9ePq8mwabqRUL3XwXNExc+HG+166f/tOSUIElMB9TE3DfQiCNJzN1Gy tIvivfX+uQHH/vK9dT9WvvmLx8+QXpcw7uwbXAbh7lWgJKSy9T7RfSE7miZszangcu0w 6rhcGz/y4JOAnbJkZVH4Yu8obasyq0OQig5LWvNxEpHXhd0FnELcnpi7fZyy7LvzEtZP ZvyDzD+6JNmGqbT839A0rA81MZTWsqUCcwLw1YnMk2K4VwGIsrDOqs4AkUvkSt2MmObk KbnA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=BS0rBnqOnJwywVyggv6WLP51bLfritdDS+YaRb6g8Nc=; b=sJQlm0dntsupYPjjwwdP8uoQeiiQqFuEATa6n7etNOMR7tj/81f3NRKPJP3Ra8jrBM 0PXCqxEumVXpCkFZAiXN4F4IyEaWsYOMRymyl2+icnyJfoHv3Z/eRnSEr80vjiyRZM6B hgL9CSnBNY6aQ2ik50/hrAuMdBvhgqswGKEYq1tZvnBMu53TWZMN/U3WvkP/gusYDYpz Bd1rYQsHpb7n/WkxrYl6HpU9ndCe1ufIWFYfYAcqHNJEt6+pgRZ38/HL0rzXnH72K+hE 2HM6NgGEu3Ssv7QC0SpjDq/f2f3+uRK8spzs9ZM7VHBJqFsp099W/Ai4jZjhZ/mzruiZ dKJQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=aS+aaNRT; 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 d5-20020a056402516500b0042dc9aafbf9si3936678ede.237.2022.05.29.23.47.21; Sun, 29 May 2022 23:48:05 -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=aS+aaNRT; 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 S232134AbiE3Blz (ORCPT + 99 others); Sun, 29 May 2022 21:41:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53444 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232127AbiE3Blq (ORCPT ); Sun, 29 May 2022 21:41:46 -0400 Received: from mail-yb1-xb36.google.com (mail-yb1-xb36.google.com [IPv6:2607:f8b0:4864:20::b36]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 31216C16 for ; Sun, 29 May 2022 18:41:42 -0700 (PDT) Received: by mail-yb1-xb36.google.com with SMTP id l204so6055272ybf.10 for ; Sun, 29 May 2022 18:41:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=BS0rBnqOnJwywVyggv6WLP51bLfritdDS+YaRb6g8Nc=; b=aS+aaNRTQ+HPNZXIUQ1ZY9Z98ln0UL2QNqEGotUtIAi4tvJ/68702ZzyURBI1Wzv2W VgPb5S1xvJIXqpCzD5yWXvdy6yFKaskDltTmKAhTTrFgTe9dd0gkeAiDaM2X35jZnxre 2KFRVXubZxahujg/CDEhPDZ2WherDnbm2TyEU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=BS0rBnqOnJwywVyggv6WLP51bLfritdDS+YaRb6g8Nc=; b=vfJAQpdkagd2v2Qy0n3HIt7VlyPvlS7FpUmG166RFiVgHLJ8VN9ymgTXDqDa5DDhsL QyojgQVCvCJlRG/plEirZXD6oMkJq4gB9KWeoCrtYWvlq6bxGYXI2BZY/85k346pr1ug JGzqcf0+H185oiXhuwqWyyh0vuzh2g4azkHm35bwfvQk6fmJ0oc5PnZmAISE3tY875Ve seWxePiLT4U0D6UGWMfLLLoZkaGiOLI+LEk8E0K1gh1J+ELzjKoWgWPvFG2gIFFvfBhY pv1djnVKor8SJkQFxhlYizBeTE7/95oRZs5HqK+w6Mya1kP356rQ895YBtA7HuTU6EfL dWCw== X-Gm-Message-State: AOAM5307lvYSRHYyRhyfP8u1iF7jwhpiXgjAI0eSI3Bfv/E0kl8cTH1r 4l/AMwsE/AgyNJcIU/KvwvPCl5CrUerpsSZu94hA77ZiB0A= X-Received: by 2002:a25:a4aa:0:b0:650:1a22:ffe1 with SMTP id g39-20020a25a4aa000000b006501a22ffe1mr31292961ybi.573.1653874901359; Sun, 29 May 2022 18:41:41 -0700 (PDT) MIME-Version: 1.0 References: <20220511222910.635307-1-dlunev@chromium.org> <20220512082832.v2.2.I692165059274c30b59bed56940b54a573ccb46e4@changeid> In-Reply-To: From: Daniil Lunev Date: Mon, 30 May 2022 11:41:30 +1000 Message-ID: Subject: Re: [PATCH v2 2/2] FUSE: Retire superblock on force unmount To: Miklos Szeredi , Al Viro Cc: linux-fsdevel@vger.kernel.org, Christoph Hellwig , fuse-devel , "Theodore Ts'o" , linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" 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=unavailable 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 I have prepared the v3 patch as described in my previous email. PTAL. Thanks, Daniil On Wed, May 25, 2022 at 8:44 AM Daniil Lunev wrote: > > > Calling bdi_unregister() might be okay, and that should fix this. I'm > > not familiar enough with that part to say for sure. > > But freeing sb->s_bdi while the superblock is active looks problematic. > Tracing the code, I see that, yes, in general that might not be safe to call > the "bdi_put" function for any FS - because it might have in-flight ops even > with force, where they will routinely access the members of the bdi struct > without locks. However, we do replace the struct with a no_op version, > and specifically for the FUSE case we sever the connection first, so no > in-flight ops can actually be there. And I am not sure if other FS may > need to do this retirement, given they don't have these > user-space/kernel split. It would make sense however to delay the actual > put till the actual super block destruction, but that would require > introducing extra state tracking to see if the block is or is not registered > anymore. It can be piggybacked on the v1 patch where I have an explicit > state flag, but not on v2. > Miklos, Al, will the following work and be acceptable? > Get v1 patchset[1], in fuse_umount_begin do bdi_unregister and set > the flag, but do not do bdi_put or replacement with no_op. And then in > generic shutdown super if the bdi is not no_op and the 'defunct' flag is > set, skip unregister part. > Thanks, > Daniil > > [1] > https://lore.kernel.org/linux-fsdevel/20220511013057.245827-1-dlunev@chromium.org/T/#u