From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 94DE8C636CC for ; Thu, 16 Feb 2023 09:30:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229861AbjBPJaV (ORCPT ); Thu, 16 Feb 2023 04:30:21 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44824 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230005AbjBPJaT (ORCPT ); Thu, 16 Feb 2023 04:30:19 -0500 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 63C151CAE7 for ; Thu, 16 Feb 2023 01:30:18 -0800 (PST) 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=EFZ2BXwFkMyBowHG13ErTQWRxsBkHRpaLPFUr4Las0w=; b=qi9dteTNc/IXSzPBnYW0B9EIKN DhqESM/931NRMUZXdqbbp+TBkQ3QW7QKoUtjNaz5T2OXByWzIv0plkOlR4sjA2MaOXIlwhIRX13Ha ufbKYnCL0yufnj437hfV4KftiMy3dLvYGkF1asu04xQT167HXygzUeXsbNHUzWnOn13dauLrFubAW 1TpqEO9ngxsx9rYipMbjusYibyllVgDLkRwqrFCpxjVwxywum+QmYbhLJ821nVjLYTUGWnAFYmwfA pBzzZ3NAd57Q2W3UvNSqsROu3HFcxWgV6eiHXm81TGRbqRuTZFa7+evnjFoSwgYfqehV03fCpbCzL 1HSf3IvQ==; Received: from hch by bombadil.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1pSaao-009Ftr-1a; Thu, 16 Feb 2023 09:30:18 +0000 Date: Thu, 16 Feb 2023 01:30:18 -0800 From: Christoph Hellwig To: Boris Burkov Cc: Chris Murphy , Btrfs BTRFS Subject: Re: LMDB mdb_copy produces a corrupt database on btrfs, but not on ext4 Message-ID: References: <124a916c-786b-42ec-bc9d-db97bb081881@app.fastmail.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 Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org On Wed, Feb 15, 2023 at 09:58:54PM -0800, Christoph Hellwig wrote: > The extract version if used for writes to zoned devices, which need > to record a physical location on a per-write basis. So what you done > definitively works, as we already do it a little later for a subset of > writes. > > I also think it fundamentally is the right thing to do and was planning > to do something similar for completely different reasons a little down > the road. > > The downside right now is that you pay the price of an extra ordered > extent lookup for every submitted bio, and that an extra queue_work is > required for the completion. In my WIP work the former will eventually > go away, and I've not found any benchmark impact from the latter. Thinking out loud a bit more: - if we go down this route, calc_bio_boundaries also needs to set len_to_oe_boundary for non-zoned file system to ensure bios don't span ordered_extents. They usually don't in my testing, and I have that change in my WIP tree for other reasons. - btrfs_extract_ordered_extent as-is actually is overkill for non-zone devices. We'll need a version of it that doesn't do call split_zoned_em as that is only needed for the zoned case.