From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=140.211.166.183 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796220422; b=oq2rloYeJRz7AuEKUlcu3Cx49ihnD1y7FbSHGt0+yeVuM3hs1aE2nyWL69emf4yriE26 Cs+SIAVbzjj0ck64RpFAP8ufuGGeSrVT6brl05smKntydCaqqXUPb0MKcjnLJTophPEnW JYGPK9996/u5F6LgVTlBxeslsSMSDYCNitMAUxcaCXh5BAaO+6YL+4zNEkEDpAOuGvhdB wGVLO22hABVkq1TO06REw2LbPJVUZfF8eZJnqn56jvyZj8UgtMNfiYk8UZrKZY1iYr2fj Exepw5+4gGzAkgZSJxGnI+6houpYHcmtzgT1lPyMfC6zEocoxBhEM+TJqFzUdkBZfiQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796220422; h=DMARC-Filter:Received:From:To:Cc:Subject:Date:Message-ID:User-Agent: MIME-Version:Content-Type; bh=siv641H9veo9lRo1aCBJrZuzWH8YWFb5lyHtzcTiFVQ=; b=4swiuHiWNk3s2BDTcMwRUrGamEeRGeh9Bwz5WpYci4cVEIhY7cSj0Mg4vtDEL/9R6X9E HqACH6CnXxlSFX5C9MMrPkWrhyXXmgGmGoD0I+mgZMlOF3pSmj5oQoFNlcEvOWqbAJ0Vw QpW12w1vp6t8YBsrnzc4PDFLnfiyY+wP5IW18SNRp2Vt9EAv44P/t5RxeZntmtNY6ariW HXyhJBgDCaLGg9ibnXW+HGoEWaw/5K63WBilxZt6VDPub7q7e+6VqMECXHVDKrqNGsA70 XUa1Id8XNDOl579XHML6Hg2qrlpawIdNX0arQczJIRcxU+8pQd6qEAvG8RcHcECmbbg== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=gentoo.org; spf=pass smtp.mailfrom=gentoo.org; arc=none smtp.remote-ip=140.211.166.183 Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (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 7A2E0606A31A for ; Wed, 2 Dec 2026 14:07:01 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 7A2E0606A31A Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gentoo.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gentoo.org Received: from urania (ulm2.kph.Uni-Mainz.DE [134.93.134.44]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: ulm) by smtp.gentoo.org (Postfix) with ESMTPSA id A684D3425EE; Wed, 02 Dec 2026 14:06:59 +0000 (UTC) From: =?utf-8?Q?Ulrich_M=C3=BCller?= To: linux-ext4@vger.kernel.org Cc: "Theodore Ts'o" , Andreas Dilger Subject: [BUG] ext4 -b 1024 -O inline_data: zeros in last page of file after small writes Date: Wed, 02 Dec 2026 15:06:56 +0100 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) X-Mailing-List: linux-ext4@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 [Forwarding Gentoo Linux bug https://bugs.gentoo.org/987733] On an ext4 FS created with options -b 1024 -O inline_data, files become corrupted after many small writes to them. The problem occurs with kernel versions 6.6.38, 6.18.65 and 7.3.7, as well as on different hardware (Atom x5-Z8350 with eMMC, AMD Ryzen 7 PRO 7730U with NVME). The following shell script (run as root because of the loop mount) reproduces the problem: -----8<----- #!/bin/bash set -e TMP=$(mktemp -d) MNT=${TMP}/mnt; mkdir -p "${MNT}" trap 'umount "${MNT}" 2>/dev/null; rm -rf "${TMP}"' EXIT truncate -s 16M "${TMP}/fs.img" mkfs.ext4 -q -F -b 1024 -I 256 -O inline_data "${TMP}/fs.img" for opt in "" noauto_da_alloc nodelalloc; do mount -o "loop,${opt}" "${TMP}/fs.img" "${MNT}" for (( i = 0; i < 10000; i++ )); do printf "xxxx\n"; done >"${MNT}/f.txt" len=$(stat -c %s "${MNT}/f.txt") zeros=$(tr -cd '\0' < "${MNT}/f.txt" | wc -c) rm -f "${MNT}/f.txt" umount "${MNT}" printf "%-20s: %5d bytes, %5d zeros\n" "${opt:-(none)}" "${len}" "${zeros}" done ----->8----- Its output here is: # bash ext4-bug.sh (none) : 50000 bytes, 848 zeros noauto_da_alloc : 50000 bytes, 848 zeros nodelalloc : 50000 bytes, 0 zeros Expected result: no zeros in either case. fsck -f on the FS after the test doesn't report any (additional) problems.