From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=79.135.106.96 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796409956; b=nP0F4CI9Fk0bUT+/0+rE/osMC2fMMsnejVUhNrytfl3VO/Lg6kUg3ptwIBF22tJlVKTn yia8lGePnPA8DdTcWI/Im6xTHWS/cb4KhEAix8/JvuGyAOIZrXiFbVIutWMnUmUtOGwGl KIGftbxBYwWWEFHYqxei2bTj1JooEmbfHe5bA18CjtJIWQhVqnr87rsqos0qRl2Qd3rMi IeBYi12f3os1sDphAK2PHWYD2x/XQkXLiRo6e1/+150Ws31J4MFov+Ixg68QKbcNYjWoe 2Ab14teAOwHEZlMsS31iO8K5CrXss0WPenf+5jOqkD23ZkmGq5o8PttM48j+iwduUfA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796409956; h=DMARC-Filter:DKIM-Signature:Date:To:From:Cc:Subject:Message-ID: In-Reply-To:References:Feedback-ID:X-Pm-Message-ID:MIME-Version: Content-Type:Content-Transfer-Encoding; bh=RJd9ADiJnGIH2/KoPJ+a9mIS6JYdX78OMEOwNFxeH7w=; b=4ACDwu2p1dBFHIrJ2cxx3YU59ZBT0zPGb2BSlrnk+msqORlt0a6jHBtKoZtLYMZqNINU lUm84dokxVc8bmf0m0zKE6bNCCfBPBM1U0g/MXplJmlC1mu5jS127uW8dSky4k7z08Ooa +P7MMZJ2KUqXfcsJOK8zyoBoaEbRMVCjvAxrzIfUZY3DoCt7a5+TvHIS5kV8jsptX0Flr 4bPNNjZm7IB7olU0R1gWwBZcjVNyEnRQfo3OTIlzzuieEJjgLh+AOa78e8Y1GsNtw8V/2 RKOhZa7BildPTFaTAPWjN6jc2A8hPrNj1lCowWmcPlBt0rH0LKJ2qTWPZIvs95LmzNg== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=proton.me; spf=pass smtp.mailfrom=proton.me; dkim=pass header.d=proton.me header.i=@proton.me header.a=rsa-sha256 header.s=protonmail2 header.b=h+J1S1VS; arc=none smtp.remote-ip=79.135.106.96 Received: from mail-10696.protonmail.ch (mail-10696.protonmail.ch [79.135.106.96]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 62E05606A32D for ; Fri, 4 Dec 2026 18:45:55 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 62E05606A32D Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=proton.me Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=proton.me Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=proton.me header.i=@proton.me header.a=rsa-sha256 header.s=protonmail2 header.b=h+J1S1VS DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=proton.me; s=protonmail2; t=1796409953; x=1796669153; bh=RJd9ADiJnGIH2/KoPJ+a9mIS6JYdX78OMEOwNFxeH7w=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector; b=h+J1S1VSJUGQblM1hh/kDlBE7NWqTxJlBGGjcCnsYZZz9GrLGPbzp3wZj+H/fopwg eedTNuDZ1NZb36j/vhdMq+1qFt6L5EbUVz4hzOKJFJfOdUVMjkY9z8zNVu+RnxpTYe OUEWa1dD/WdHBY+mpDMw37z/FjnT+rtq4avWFtqTiz/6tyJweDx21zpE/HnTy87yhO XtEcbXKVMfJCMEVnaxErE7DNZzrEaKKm523EbdYKDrR0HoLyqRPBtSF6tNLmuBr16N a2DQyEIuNQm54nF8I2qKjr8+uogHcPg9Qgo0rGlrTm/S1N6DEq9GlwSjx6K2bu45qQ SQlYc94mddOlg== Date: Fri, 04 Dec 2026 18:45:47 +0000 To: Baolin Liu From: Ernest Borowski Cc: linkinjeon@kernel.org, hyc.lee@gmail.com, ntfs@lists.linux.dev, linux-kernel@vger.kernel.org, Baolin Liu Subject: Re: [PATCH v1 01/13] ntfs: limit writeback allocation to the dirty range Message-ID: <179640993906.154108.3521906504217124720.b4-reply@b4> In-Reply-To: <20261203040352.1161120-2-liubaolin12138@163.com> References: <20261203040352.1161120-1-liubaolin12138@163.com> <20261203040352.1161120-2-liubaolin12138@163.com> Feedback-ID: 236360163:user:proton X-Pm-Message-ID: de7d933e0a3bdf9c7c9bcc4196ae659bcd95ae5b X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hi Baolin, On Thu, Dec 03, 2026 at 12:03:40PM +0800, Baolin Liu wrote: > A buffered write into a hole reserves space before copying user data. > If the copy faults partway through, writeback can allocate the clean > remainder of the reservation because it maps up to allocated_size. > After fsync and cache eviction, reads can expose old disk contents > instead of zeros. Patch 13 of my delalloc series v5 [1] fixes the same bug in a different way: writeback maps up to the end of the dirty folios that follow the one being written, and zeroes a cluster larger than a page on the disk only when some of its folios below initialized_size are not dirty. I ran your patch, ported onto patches 1-12 of v5, through our reproducers on the current ntfs-next. It passes the same ones as patch 13 (killed_short_write_wb, hole_fill_stale, stale_wb_race and the others). Mapping one dirty range at a time costs time with clusters larger than a page, because every new cluster is zeroed on the disk before its first folio is written. fsync() of 384 MiB written into new space, 3 runs each, on a kernel without debug options: cluster size your patch patch 13 ntfs-next 512 B, 4 KiB 98-113 ms 111-140 ms 172-204 ms 64 KiB 242-260 ms 110-120 ms 170-177 ms Your patch also makes mkwrite_past_init pass, which patch 13 does not. That test stores through a shared mapping 2 MiB into a file whose initialized size is 4 KiB, and then reads the tail of the first cluster. Your patch zeroes the whole first cluster when the first 4 KiB are written back, so the tail happens to be zero. From reading the code, a cluster allocated another way, for example by fallocate(), would still show old data there; I have not tested that. Zhan's "ntfs: zero up to a page that a shared mapping makes writable" [2] fixes that case where it starts, when the write fault moves the initialized size. Would you be fine with dropping 1/13 from the large folio series and basing it on the delalloc series instead? I have not tested the large folio patches on top of v5. [1] https://lore.kernel.org/all/20261204-b4-ntfs-delalloc-fixes-v5-0-1cd026= 7df2cd@proton.me/ [2] https://lore.kernel.org/all/20261201125126.1651071-1-zhanxusheng1024@gm= ail.com/ Thanks, Ernest