Received: by 2002:ab2:710b:0:b0:1ef:a325:1205 with SMTP id z11csp1119583lql; Tue, 12 Mar 2024 07:51:15 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCU+IAgH2YWHlgde3UPklIdXFZmNNQwnYzbqKr8ORPKe3AQLpuzeQl9g0q7r3y41wJ4TsOim4ACjit0y3aUu+q9Z0yC2ndDYwpbXjdmjyw== X-Google-Smtp-Source: AGHT+IEP4KbYD2llKbKu4Cn2I3sY9Jx6XK9nFY9nJyN37mmvUA6kXUebRkWNrAX3jeQl1kI4nZjh X-Received: by 2002:a0c:fd8b:0:b0:690:ae50:780b with SMTP id p11-20020a0cfd8b000000b00690ae50780bmr2187021qvr.34.1710255075488; Tue, 12 Mar 2024 07:51:15 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710255075; cv=pass; d=google.com; s=arc-20160816; b=JVCUNXUkpsly2YXn06XXe73TDritYTg6TUHAORx0cGQ8z+8TJqkyfb+KK3boI7m8Fr HZxYrrBHffG30S7mMIIqdyb9K24uo3Y+AGKuyr21FG+IziahexCI92cJonehhhWbTPre C3TlDkwy0zfg5/p+rGB+tFiKcNJemu6TljWHPuxNR49IP3W0jZ/VyeHFVX2cde+1JK5N lyZvVuRWVLe746321Q16rqUII94eRW2GavOyOTtLcRq11LsYxblVE+rxk+zLQD8uQkec wd2s3uxaP7nStI1+xApbw0GEZ2Ewb3DEtSMgzwpBdquRpYZu9T02NVEzoFX0KnLHa6VH oPCA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=0Thwm6eWyU+1fiGj99ssaAe6TjuTB15OZV9JAlunu2s=; fh=ZpK2BA/JkmeaJ2rKQyc5Np9nnD5JITGkhkNo7DhWPRU=; b=IPRdiS4XNxO8uOcRWzHlQiIvVNy4a+u8hKJ7FGhQ2coWCVxuLICvEhha8DrYlgZ+8Z Bnv9wt88M6IUzJpDXmL+ED7u9HEf1aZ9k9yhmkC6pOuAqjfyUvN4MD3wiWuw3t0EHTTR EaK4yPNpp8AyzUGEaPXTTGTPgSTSCWygj28TzBOBDkeSJrKp9TyKZS2/vK3GToIn6QIR UXaacJaTDcaWOekXIlGr2csLcI+gPhZjWVSb/zBaSdgqUNfbAytLsUDzCjnwq03tG8hg T/eKb/ba5l4aQ4nPG0GeJ5JwbrIjZZGZe3nQnnfPm2UBf35pTkTW0xJFtzIEf3PPILY1 Op9w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=jl3fKkjo; arc=pass (i=1 dkim=pass dkdomain=infradead.org); spf=pass (google.com: domain of linux-kernel+bounces-100252-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-100252-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id r17-20020a056214125100b00690dc28cc14si2925219qvv.536.2024.03.12.07.51.15 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Mar 2024 07:51:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-100252-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=jl3fKkjo; arc=pass (i=1 dkim=pass dkdomain=infradead.org); spf=pass (google.com: domain of linux-kernel+bounces-100252-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-100252-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 2015C1C22818 for ; Tue, 12 Mar 2024 12:21:55 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4D3377A13F; Tue, 12 Mar 2024 12:21:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="jl3fKkjo" Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 18B6DBA28; Tue, 12 Mar 2024 12:21:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.137.202.133 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710246106; cv=none; b=BswiiX21mSzDltVZs2q1TpInP9eQlqnX89ZenRUkxod9aFRF+QA8lP7s0UAGX6g8IY3WM0VKCYFkdBeo373H9v45QdJwvz+vm5oVTy4B4VyEAHJhrVHX0562U+BQ2LI17JqCTa4Am3mfdisef3JDaAnbo3+jNb9FtDTksLNeB3s= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710246106; c=relaxed/simple; bh=PRHWmlunvFb/pRfUsLAeTv57hVkovzdTkLol1agdvUA=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=P0UVIF/cJNlo24MwjvUEq7PeCsE8RXW4AD616fWrJ029vAB4gfUD28XWxHqeril+1cLhmpjKjXVHWQvw+1MQWctQUvhsbf4ZNm2V+YrPX6+mn6CQsgal9PFdUQpOEP0EJ1yG/XM/Akfwkfnh1OFGKkYHJivCt+4puVzJ1fScIJQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org; spf=none smtp.mailfrom=bombadil.srs.infradead.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b=jl3fKkjo; arc=none smtp.client-ip=198.137.202.133 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=bombadil.srs.infradead.org 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=0Thwm6eWyU+1fiGj99ssaAe6TjuTB15OZV9JAlunu2s=; b=jl3fKkjo8VwqfsRjRM5aU5Rcpn LUPPMetFNgZXWAxH0WtthDTdP745OWuDz9XV/W3/4FMLEeuO/2jM9V3Max3KNqcZur2xpsB2wRGMK 193eVtKJN/Pw/8i4rb1uVzZKwglFmQf8/ZcHYQpfZU24P6SL3qxn3cWRj4hf7fb1EMl4/JNp33se2 GT4rN8pwJjsqUiqzOV61wIe/SNbq3StwCDkGDxrHU96GbzoacvKVerakdAIDHWSGY2pIs8e32rZM2 KPaZ7vh+wbqWgFxw3zKdCk2kJh7ZXN0qgIm60v25DKQieTFZn2+Hd9zmDYh8vuOC7tJpS33v3ntMW LX6oKaRw==; Received: from hch by bombadil.infradead.org with local (Exim 4.97.1 #2 (Red Hat Linux)) id 1rk18Y-00000005igE-0oWv; Tue, 12 Mar 2024 12:21:42 +0000 Date: Tue, 12 Mar 2024 05:21:42 -0700 From: Christoph Hellwig To: "Darrick J. Wong" Cc: Zhang Yi , linux-xfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, hch@infradead.org, brauner@kernel.org, david@fromorbit.com, tytso@mit.edu, jack@suse.cz, yi.zhang@huawei.com, chengzhihao1@huawei.com, yukuai3@huawei.com Subject: Re: [PATCH 2/4] xfs: convert delayed extents to unwritten when zeroing post eof blocks Message-ID: References: <20240311122255.2637311-1-yi.zhang@huaweicloud.com> <20240311122255.2637311-3-yi.zhang@huaweicloud.com> <20240311153737.GT1927156@frogsfrogsfrogs> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240311153737.GT1927156@frogsfrogsfrogs> X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html On Mon, Mar 11, 2024 at 08:37:37AM -0700, Darrick J. Wong wrote: > > +convert_delay: > > + end_fsb = min(end_fsb, imap.br_startoff + imap.br_blockcount); > > + xfs_iunlock(ip, lockmode); > > + truncate_pagecache_range(inode, offset, XFS_FSB_TO_B(mp, end_fsb)); > > + error = xfs_iomap_write_direct(ip, offset_fsb, end_fsb - offset_fsb, > > + flags, &imap, &seq); > > I expected this to be a direct call to xfs_bmapi_convert_delalloc. > What was the reason not for using that? Same here. The fact that we even convert delalloc reservations in xfs_iomap_write_direct is something that doesn't make much sense given that we're punching out delalloc reservations before starting direct I/O.