Received: by 2002:ab2:1689:0:b0:1f7:5705:b850 with SMTP id d9csp657481lqa; Sat, 27 Apr 2024 20:26:19 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUsWIhJaOh9xHM1dTWbRWI7Xla9T99lHGvqUXU3J1hvEt/6fk7KCdh3N6g/xywLaxSeUc18NayPg44pNPKU7JBv0QjEr4NkAq4162uafA== X-Google-Smtp-Source: AGHT+IHj6RJleBuJc/63Awf8rVA24ZPS/fV9F8j/iMHRshVJOveAFl7BPDHy/HvQTxyfcE225rDC X-Received: by 2002:a17:906:3d2a:b0:a58:bb3e:9376 with SMTP id l10-20020a1709063d2a00b00a58bb3e9376mr4680194ejf.61.1714274779029; Sat, 27 Apr 2024 20:26:19 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714274779; cv=pass; d=google.com; s=arc-20160816; b=AH03YRb0aj5UuNfbVm8GnpSquhQfo+qlaYGZawoHAckZPBE0l9Fw6xm7ftpvcYz96V J3Iw9ndUlRZNcv2oFwka4LBzAxzMhe/DsBCLW/CbNwzwf76S699DXs6t8EBI//Ufaym4 jRKEmBXjIedzIeYC2Vpvm6SNRSOzqGVj6m+K6kevaWjCx7vLbXSsZj/u5mxou4/ssRds qGzbrj0IVz+MsTU8xG1WycNVOUVlKhzlPJXVVzAXFS/SyoTrlK9hFb6igKmePtDQX7Vm MUgMZQfR3NDORmpkPWCjDoPirk6bxRNZukELzCnkk28mEzEW1kTp+TT8h2zNIbouHBi3 nVRg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:content-language:in-reply-to:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:user-agent:date :message-id:from:references:cc:to:subject; bh=oxiV2JYs3s5QUrUwz2xjzWmwUo5myD3/8YlZ3o5re7s=; fh=oO9urCl7eJP2xBAA85azXSw7QBNylZRuJwxwIQWPjXI=; b=mJHRCIxBijeFDyF5k1azu9i/tOheMtc/DOIQZrsKn9jnnbpvSJLNzTu2lXMuvnGcrA nXff3wucv4pt8SMvhpvV4YdAdsydoOX3sEGRELp5JOUPhBrhuyLLGA3V/HIuXgpJHws8 FBBg0ToJcQjrsOl5Y+TvnK3TvcpMbPr3YsWtrKwlsPWG3H6NxC9j3gpUUth5fCF4e5Jo NtQuCR4I49IA9me6ngHmvkzLPWpNQ/qWPFUsgxhqL6yiVZs0KKLRmSvQa6XBSb0JPU5Q jbF+gJMUdS6CPtHNontYymWXvjX/uIzhZ0C9fjqCWN+40zQ2JElgD+IdVqvnDFFYTFQZ M6Vg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=huaweicloud.com); spf=pass (google.com: domain of linux-kernel+bounces-161242-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-161242-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id n5-20020a170906118500b00a48b954b0acsi12844186eja.164.2024.04.27.20.26.18 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 27 Apr 2024 20:26:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-161242-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=huaweicloud.com); spf=pass (google.com: domain of linux-kernel+bounces-161242-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-161242-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 am.mirrors.kernel.org (Postfix) with ESMTPS id C0E2E1F21B73 for ; Sun, 28 Apr 2024 03:26:18 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 17FF93C38; Sun, 28 Apr 2024 03:26:09 +0000 (UTC) Received: from dggsgout11.his.huawei.com (dggsgout11.his.huawei.com [45.249.212.51]) (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 5805A1854; Sun, 28 Apr 2024 03:26:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.249.212.51 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714274768; cv=none; b=G6dXRwcGYpbq7VjpHEHxBHdBvi91ywGeY9JAfksdv480mJ01k6X0JRAwyhOM7xaHbR1qYVo/oKVURosohX2RLodTTtWMCQ9fULgbooM5U+Q8dICqqgoS6FhIuMfSbgRCpcbJfVKoqlk3ohUUJeWBjF0Y8kHnULMNy9DWXq15+dg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714274768; c=relaxed/simple; bh=dRbYW5r1aha79uQUUDDP7FX0PER5xuIeZ/k7nBZKlQs=; h=Subject:To:Cc:References:From:Message-ID:Date:MIME-Version: In-Reply-To:Content-Type; b=cmY6WszkunThFlqRB8YjiNfj6VDXTp1XdOAjMbCo4Lvi/69vvIpH0zudJ3nakWdFUKA1mlOtSnC7mJpSwDv14uqdQIoPM0sit3U4ydCRahgZc1TWViN4yOL0cwIbgQ1jdfduzl6OShJub5QBqBXZKBS9Q5D/pHsXsFj+vzSYiY4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=huaweicloud.com; spf=pass smtp.mailfrom=huaweicloud.com; arc=none smtp.client-ip=45.249.212.51 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=huaweicloud.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huaweicloud.com Received: from mail.maildlp.com (unknown [172.19.163.235]) by dggsgout11.his.huawei.com (SkyGuard) with ESMTP id 4VRsLF1V3tz4f3k6h; Sun, 28 Apr 2024 11:25:57 +0800 (CST) Received: from mail02.huawei.com (unknown [10.116.40.75]) by mail.maildlp.com (Postfix) with ESMTP id 2D14A1A0568; Sun, 28 Apr 2024 11:26:02 +0800 (CST) Received: from [10.174.179.80] (unknown [10.174.179.80]) by APP2 (Coremail) with SMTP id Syh0CgBXfA_IwS1m1qSpLQ--.48414S3; Sun, 28 Apr 2024 11:26:01 +0800 (CST) Subject: Re: [PATCH v5 4/9] xfs: convert delayed extents to unwritten when zeroing post eof blocks To: Christoph Hellwig Cc: "Darrick J. Wong" , linux-xfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, brauner@kernel.org, david@fromorbit.com, chandanbabu@kernel.org, tytso@mit.edu, jack@suse.cz, yi.zhang@huawei.com, chengzhihao1@huawei.com, yukuai3@huawei.com References: <20240425131335.878454-1-yi.zhang@huaweicloud.com> <20240425131335.878454-5-yi.zhang@huaweicloud.com> <20240425182904.GA360919@frogsfrogsfrogs> <3be86418-e629-c7e6-fd73-f59f97a73a89@huaweicloud.com> <5b6228ce-c553-3387-dfc4-2db78e3bd810@huaweicloud.com> From: Zhang Yi Message-ID: Date: Sun, 28 Apr 2024 11:26:00 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.12.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-CM-TRANSID:Syh0CgBXfA_IwS1m1qSpLQ--.48414S3 X-Coremail-Antispam: 1UD129KB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qx5xdzvxpfor3voofrz/ On 2024/4/27 14:59, Christoph Hellwig wrote: > On Fri, Apr 26, 2024 at 03:18:17PM +0800, Zhang Yi wrote: >> I've had the same idea before, I asked Dave and he explained that Linux >> could leak data beyond EOF page for some cases, e.g. mmap() can write to >> the EOF page beyond EOF without failing, and the data in that EOF page >> could be non-zeroed by mmap(), so the zeroing is still needed now. >> >> OTOH, if we free the delalloc and unwritten blocks beyond EOF blocks, he >> said it could lead to some performance problems and make thinks >> complicated to deal with the trimming of EOF block. Please see [1] >> for details and maybe Dave could explain more. > > Oh well. Given that we're full in on the speculative allocations > we might as well deal with it. > Let me confirm, so you also think the preallocations in the COW fork that overlaps the unreflinked range is useless, we should avoid allocating this range, is that right? If so, I suppose we can do this improvement in another patch(set), this one works fine now. Thanks, Yi.