Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 B22FC245019 for ; Wed, 25 Feb 2026 01:49:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771984153; cv=none; b=W2lo9JnMqtzvln9WfhrWT7Xh2WEMNdhv2HvoDIp5z9N9mCta7J9L4basz47qkzhkxcwWkMt6oDeastXLt4SkoRtDGGVMrnXcRAMZLJbWvXlNOvrS+BG2J0vE9u/bTM6azZJVUuKH5InSMjLwvOJzno666Hokx5Us1ZAtLk0wueU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771984153; c=relaxed/simple; bh=vDhAu4klWZkGVNLgxLGYj17iCJyfHjninfuy9ogeC3w=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=qfyywDLO82pseTv9HTvUlRv1iToHls1B87VjICKm6yMDskRarnD2nFzKjQSTDXWk0rnUgGuJ0iahg3BWaiRkBSlyQnZ4e7jUX6/L7ZiCJH/hPETdDvGDeUX5alymtYhspNuq4VAFPNhYRCaG5Onzd9inBh344VyJy5DXiDRuA8E= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=BGiNgX7w; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="BGiNgX7w" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 070CFC116D0; Wed, 25 Feb 2026 01:49:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1771984153; bh=vDhAu4klWZkGVNLgxLGYj17iCJyfHjninfuy9ogeC3w=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BGiNgX7w41EN8a3POzRRrvD/awA2QnfsujsLs3HCJwX0iuYGe3Wi7vWWcKUY3tc88 UDbAl0hAD2imAiMbVXddNcRPi4UcApy7icnpQ7kn9vRT0uDLC6BcAfii8lLK4BaYLl Wp/p7oLhZciyNhwRRGvhYlEtpzbKtd6NGGuqrEB90WWHtQ+3Ok3HKbawT9iJIPhIBZ zXJvl0SM2maNqY89+ZhvVuVDJtb8YxZrcH1oQdSsZ2JVoe0gLgAVX2wwdUy8bwgt9Z wCzaqSNpirS9BDbBZ5tn026Ed39EtluIb/focgKbHzWPCas2BjMdM+klBez1HwKULV B0NdCeF0+qNoQ== From: Sasha Levin To: stable@vger.kernel.org Cc: Yang Erkun , Theodore Ts'o , Sasha Levin Subject: [PATCH 6.18.y 1/3] ext4: correct the comments place for EXT4_EXT_MAY_ZEROOUT Date: Tue, 24 Feb 2026 20:49:09 -0500 Message-ID: <20260225014911.3767562-1-sashal@kernel.org> X-Mailer: git-send-email 2.51.0 In-Reply-To: <2026022418-mulberry-curliness-5860@gregkh> References: <2026022418-mulberry-curliness-5860@gregkh> Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Yang Erkun [ Upstream commit cc742fd1d184bb2a11bacf50587d2c85290622e4 ] Move the comments just before we set EXT4_EXT_MAY_ZEROOUT in ext4_split_convert_extents. Signed-off-by: Yang Erkun Message-ID: <20251112084538.1658232-4-yangerkun@huawei.com> Signed-off-by: Theodore Ts'o Stable-dep-of: feaf2a80e78f ("ext4: don't set EXT4_GET_BLOCKS_CONVERT when splitting before submitting I/O") Signed-off-by: Sasha Levin --- fs/ext4/extents.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c index ca5499e9412b0..bce4cd8851380 100644 --- a/fs/ext4/extents.c +++ b/fs/ext4/extents.c @@ -3721,10 +3721,6 @@ static struct ext4_ext_path *ext4_split_convert_extents(handle_t *handle, >> inode->i_sb->s_blocksize_bits; if (eof_block < map->m_lblk + map->m_len) eof_block = map->m_lblk + map->m_len; - /* - * It is safe to convert extent to initialized via explicit - * zeroout only if extent is fully inside i_size or new_size. - */ depth = ext_depth(inode); ex = path[depth].p_ext; ee_block = le32_to_cpu(ex->ee_block); @@ -3735,6 +3731,10 @@ static struct ext4_ext_path *ext4_split_convert_extents(handle_t *handle, split_flag |= EXT4_EXT_DATA_VALID1; /* Convert to initialized */ } else if (flags & EXT4_GET_BLOCKS_CONVERT) { + /* + * It is safe to convert extent to initialized via explicit + * zeroout only if extent is fully inside i_size or new_size. + */ split_flag |= ee_block + ee_len <= eof_block ? EXT4_EXT_MAY_ZEROOUT : 0; split_flag |= (EXT4_EXT_MARK_UNWRIT2 | EXT4_EXT_DATA_VALID2); -- 2.51.0