From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=109.224.244.25 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796146956; b=JyNf5rz6s2PIQu0p3OMfjpp7DTuddlAA1dSyjS2X+mkRloW53lVtvhUdmLI7EgQ4Rmul PQ1hWdPNasoWiQN9SguVd3xFcnH1r2tNi1/V1pwdNMa7yi3q/8dNWsAW1BcSocJ1i6y/z C2+NuMTGeC7atuYZgs4hGDJlB2aCdbYs3WOfQomB1NTFUTHDqW3k7+BUgfzXe7IHlTdqr Wit26+/qKpX+cdHjlaCuQD77XLYh3pe1bslwbjLk3JQIUe7G8IkltqampYwnm+qhkH9Nk Rur7RRe4NbOvV8QND+L0SKPxWXpux2dLryYsMuuFXBKx6O6VicVHLNkP3ZEc8JIbrag== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796146956; 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=gzMIASrQUD2BEHf9h09YTEqJQMkSJBchHZBymRIyQg8=; b=N+URmc68V2LL3WRvtbviD6TbCDDkk+us2NA7rnaOR3EvlvQFd0pAChbZR6HBZL04X4f8 h270p6Bwf6vaGuH3HNVQfGNDZFSG12IZfy9F4aT3t26V6rQXCunS5160HdJLg1IArJ+WO /qDpFfTuzD4CUvk07TTlfvQO+vu3Wuj2hN2IrpgHbWCwfJMj1qXOHRpGbLwF4QVFAamsS g1pV3Ff9qq7mK+xzfNbWxnSd/NRsY1CoysiA0B2s48VCbAGSyO2NUTuveNOV8JLYJgqYI nIgkCQAhIpu1TE+wGa+Pbd82Oj4HIXCuizWcsRI7lMdJRYhmd+mO8sXH3Prg65/ctrw== 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=GqYkDGlo; arc=none smtp.remote-ip=109.224.244.25 Received: from mail-24425.protonmail.ch (mail-24425.protonmail.ch [109.224.244.25]) (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 324F8606A32E for ; Tue, 1 Dec 2026 17:42:35 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 324F8606A32E 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=GqYkDGlo DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=proton.me; s=protonmail2; t=1796146952; x=1796406152; bh=gzMIASrQUD2BEHf9h09YTEqJQMkSJBchHZBymRIyQg8=; 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=GqYkDGloClT6ct5HDp8cg1QDAcLhGEX3twfv5hrQuOmZI5HIb2mgWEETLAZb14cHN L8gTR07g/EzTu/YHYwKhfjAdaeuTe8YQhGC854NV6wUj8r45L5+EnCzHZF1n7GXgfk AUdThEysJkIhgHBlx5aV0o8NyVgc4zLVlgGukIJobgIgyxyGQra6eXuabrI8iT1+Uv jKbb95OcaBGRhksuNipYZ61XE/6T4eecheagxZ3WIn+sr+1Zg6rXgWW7r24+rdhirP DWSWmzjpQKG9kd8LQJfcTH8d6mar9JBRNL/eE+yhpBOe1FEYuyFl1JvJxHMQcMZvnm mZMeZY70g0L+A== Date: Tue, 01 Dec 2026 17:42:26 +0000 To: liubaolin From: Ernest Borowski Cc: ernest.borowski.git@proton.me, Namjae Jeon , Hyunchul Lee , Christian Brauner , Christoph Hellwig , "Darrick J. Wong" , ntfs@lists.linux.dev, linux-fsdevel@vger.kernel.org, linux-xfs@vger.kernel.org, linux-kernel@vger.kernel.org, Zhan Xusheng , stable@vger.kernel.org Subject: Re: [PATCH v3 10/11] ntfs: zero the rest of a new cluster after a short buffered write Message-ID: <179614694023.3867606.441277987058381329.b4-reply@b4> In-Reply-To: <7bba2d49-ef11-4fe8-b949-1f396c3207b0@163.com> References: <20261130-b4-ntfs-delalloc-fixes-v3-0-874d34a6f1fe@proton.me> <20261130-b4-ntfs-delalloc-fixes-v3-10-874d34a6f1fe@proton.me> <7bba2d49-ef11-4fe8-b949-1f396c3207b0@163.com> Feedback-ID: 236360163:user:proton X-Pm-Message-ID: 7105a56c9e4449ce671b827b86a0e7be62a3365c 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 On Tue, Dec 01, 2026 at 10:26:49AM +0800, Baolin Liu wrote: > Could we also call mapping_set_error(inode->i_mapping, err) here? > The write can still return a positive short count when the tail > zeroing fails, and ntfs_file_fsync() doesn't check NVolErrors, so a > subsequent fsync() could succeed without reporting this error. Yes, thank you. ntfs_file_fsync() ignores NVolErrors() and sees only the errors that file_write_and_wait_range() returns, so fsync() returned 0 after a failed zeroing. v4 records the error in the mapping: =09=09if (err) { =09=09=09ntfs_error(vol->sb, =09=09=09=09 "Failed to zero [%lld, %lld) of inode 0x%llx after a short w= rite: %d", =09=09=09=09 start, end, NTFS_I(inode)->mft_no, err); =09=09=09NVolSetErrors(vol); =09=09=09/* the write returns the bytes copied; let fsync() see it */ =09=09=09mapping_set_error(inode->i_mapping, err); =09=09} fsync() then returns that error instead of 0. A new test checks this [1]. It does a short buffered write into a hole, uses fail-nth to inject a failure at each fault site of that write, and checks fsync() whenever the zeroing fails. The zeroing failed 33 times, with 16 KiB and 64 KiB clusters on Ubuntu and Arch. After each of them fsync() returned 0 on v3, and it fails with ENOMEM on v4. v4 also drops this patch's own copy of ntfs_zero_range_unkillable(). Now that Zhan's short write fix is in ntfs-next, the patch uses the copy in file.c instead. It also adds the lockdep check of the invalidate lock that its own copy had, as both callers hold the lock. [1] https://github.com/xerrni/linux-ntfs/blob/master/tests/delalloc_tail_ze= ro_failure.sh