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 48F09C6FD1D for ; Tue, 7 Mar 2023 17:10:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229904AbjCGRKM (ORCPT ); Tue, 7 Mar 2023 12:10:12 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50800 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231129AbjCGRJs (ORCPT ); Tue, 7 Mar 2023 12:09:48 -0500 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EC35698849 for ; Tue, 7 Mar 2023 09:04:36 -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=oZ5dcooyOPNgtX1t7n2EZ27kFb11B0JuiR/HOK6T/9Q=; b=vf8w2JKxL+Zofae/z58HULKlrs aG5X4sJ2YYE+O/z6phTH6BxEQxhx7kg2yms6sfxJyLLesZP8+EZp5L3djc3TLrIPxz4HVN18jZ1hq VisdFBzbpH8dDxMg1S/Z7LlNY0WE6hybNgqGLmNlFQ3lHDvgFshugzJfKht6BoUQFIiyvkHQVM1ZL OEi8F0wtWYUU2ou94OCbIPI0l1Z+l20KjNrLWttXWnuFwo6BwfI2YO8dp25MsdrcjaNG13dr7kl9g XXWSl30wRLfUfugMfLxR01Yi13qLaNAaWHGojCkB6hvsg6HCLInK1fdMPaI9M5by0LpsQF4fBhO/D /QeKP3Tw==; Received: from hch by bombadil.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1pZaj7-001jIg-OH; Tue, 07 Mar 2023 17:03:49 +0000 Date: Tue, 7 Mar 2023 09:03:49 -0800 From: Christoph Hellwig To: Goldwyn Rodrigues Cc: linux-btrfs@vger.kernel.org, Goldwyn Rodrigues , Johannes Thumshirn , Josef Bacik Subject: Re: [PATCH 06/21] btrfs: wait ordered range before locking during truncate Message-ID: References: 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 So, one thing I've been wondering about for a while is why btrfs even does all these explicit waits for ordered extents. The ordered_extent is effectively a mechanism to describe a range of I/O. So why can't we use the nornal mechanisms to wait for I/O, that is the completion of writeback for buffered I/O (i.e. filemap_fdatawait*) and inode_dio_wait for direct I/O? I've been wanting to look deeper into this for a while, so this might be a good time to bring it up.