Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp9171028rwp; Thu, 20 Jul 2023 00:09:33 -0700 (PDT) X-Google-Smtp-Source: APBJJlG/jAq8g6yqdWI3QwFEBD29r0EkqPNC5fLxQN83XRMlm/DFHX1dfriczA1gdMnAIJ2cETK3 X-Received: by 2002:a17:907:994c:b0:993:da87:1c7b with SMTP id kl12-20020a170907994c00b00993da871c7bmr3561282ejc.10.1689836972769; Thu, 20 Jul 2023 00:09:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689836972; cv=none; d=google.com; s=arc-20160816; b=AbDNASYvMGRplfYHXQ4o/NWmGutQw0mLvrjSwqmkSj2RZS3VKL4AEgQ7YyO5nzsxqe bmiNvOXQNukgINlU385y1NX7OiMd5rXVXCDx6viy5D2ZWtqtpSXGnwmEXEXE84E4/1gB N0HVzx6XiDlDtmzLWqC2I++CkuIAtKjBaCxdF5Ln2ihe8svb1wo/1GunnTt1+nY043MG kBNCI0mziPPAu318t3yMIJK9ut2qeA8pL33249xRZP10/otzbPvQm/+fa/WcveHt6kB2 d8RTvx9KtB2swaReKFktqAwngH/kPEVZaCjWKDj6nCKB2J5Aft+hUMv++fWuTZCC7HeU tqFg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=z8bMcYL2sfItal6IPN1MaB7xzF8i69WDSnHwMDnwZ2A=; fh=3rJ2QrC4f20n7zKkXH1uHxcNqcyJsbjW4/phMqhZbcA=; b=GW5gjnxyObISY0uLP+95GvxhQazynsimSWhNi6Zn7ZoGyfL9rETHNv95C3hEqQ6oGT sOKtTDZJqPzBWBobC5gDh3o8MTWH12ksbhYl4cmqaYRpcFaOR9See+KAmQ1TmgUcu7Ja IgRDb9xP3JCnYRJQMM0D+UXHDwJfnsoCmfDPJRd4K56DJFKIS/Ed569AP/sc9dT3ePSw H2n5jWWDVQzPGI/PIDLmzKXRjuDu7oTzPulUfMm4eG9232bQJz8GkJXp/A0sIHyp++h+ 6RwYuhixunHVImoqfLke1QgCiBbtoNSA6+tFpDWUmaDQHI/GyIiSKXAYngwaG1vUH9pF sRLA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=iCftUFPY; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j23-20020a170906095700b00993690d17a2si303255ejd.5.2023.07.20.00.09.09; Thu, 20 Jul 2023 00:09:32 -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=@infradead.org header.s=bombadil.20210309 header.b=iCftUFPY; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230013AbjGTGPX (ORCPT + 99 others); Thu, 20 Jul 2023 02:15:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59566 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229451AbjGTGPW (ORCPT ); Thu, 20 Jul 2023 02:15:22 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 03F1919B2; Wed, 19 Jul 2023 23:15:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=z8bMcYL2sfItal6IPN1MaB7xzF8i69WDSnHwMDnwZ2A=; b=iCftUFPYgfzlWh7j3fpyVulRXo ba4PcyoOflOzDAEsmAZv96NBFLZKtt9i6/HxH6cktJPdkgDWm8jJ5w8TquEBW3dYmxQNZxR8LOz3J 9kdB7IRUvPKYHLXTAAdhCQLz5Ux13wtOjtXuseNEDLVvqOQUB9kAXvC27L791ckcJS5Dqjh8laT8d 2fiuDjLMqnOxXvsCAhrFY0ClDR7ARN9aGZCw2wDvcHyJKEquXCzkLMb0CAxd8FG9Ug3vB29G1lkg7 6xUZG29bDDGCOhSfITFLVEYxZdZ0ZhpUYHRk/gef+6Hr2LP0+yeBijY5QVk/scwD3ASrcyZ67hLxE 9CKqaO5w==; Received: from hch by bombadil.infradead.org with local (Exim 4.96 #2 (Red Hat Linux)) id 1qMMvx-009uI8-1n; Thu, 20 Jul 2023 06:14:41 +0000 Date: Wed, 19 Jul 2023 23:14:41 -0700 From: Christoph Hellwig To: Yu Kuai Cc: Sergei Shtepa , axboe@kernel.dk, hch@infradead.org, corbet@lwn.net, snitzer@kernel.org, viro@zeniv.linux.org.uk, brauner@kernel.org, dchinner@redhat.com, willy@infradead.org, dlemoal@kernel.org, linux@weissschuh.net, jack@suse.cz, ming.lei@redhat.com, linux-block@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, Donald Buczek , "yukuai (C)" Subject: Re: [PATCH v5 02/11] block: Block Device Filtering Mechanism Message-ID: References: <20230612135228.10702-1-sergei.shtepa@veeam.com> <20230612135228.10702-3-sergei.shtepa@veeam.com> <90f79cf3-86a2-02c0-1887-d3490f9848bb@veeam.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE,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 On Tue, Jul 18, 2023 at 09:37:33AM +0800, Yu Kuai wrote: > I haven't review blksnap code yet, but this sounds like a problem. > > possible solutions I have in mind: > > 1. Store blkfilter for each partition from bdev_disk_changed() before > delete_partition(), and add blkfilter back after add_partition(). > > 2. Store blkfilter from gendisk as a xarray, and protect it by > 'open_mutex' like 'part_tbl', block_device can keep the pointer to > reference blkfilter so that performance from fast path is ok, and the > lifetime of blkfiter can be managed separately. The whole point of bdev_disk_changed is that the partitions might not be the same ones as before..