From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 CFB1538DC44; Sat, 17 Oct 2026 16:48:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1792255735; cv=none; b=uS2HWQvmver4olzq5uRsR3MkmywVwYeBiR0fdhYYMm/0wcMRbLiCaU/Vn18IRV8i9gjXHizN3hdY4TNDJeOpO/JY30Vt62zni+X8x4VtxCHDkuZn59Ops1gOW+QYxM60pjp4H8C9QDC1oK0Gf+pJ+zHl6xYDQR10WchFXni1Rek= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1792255735; c=relaxed/simple; bh=9F+xAawk8F4behXnMCmkAdQrAFMfP9XEBcKyHTTR9/s=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=W/AIe+u+XT4BmkTgo5OZ9ZhlT7zaqpRbl08KyZYB4ouL2Y6g8PHTpKWo78nzNQFwzqtN1K2rpUSWzeIcFKy3/1A43RyfdM187FIKIZzdOTzR5BsaNq0JqGTjtMmNrYi4fgKnERaNUtVn0Bb8SaoSirMKJmpYGIWqW3CvyVI0IeY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=ZGKI62pQ; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="ZGKI62pQ" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 38F6F1F000C4; Sat, 17 Oct 2026 16:48:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1792255734; bh=qq27NeUmf1hT0AyPcF6XOLclGaNrPHrmTlNnLZMso7A=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=ZGKI62pQrYm39xLy/GhBugKfj6mV+u16PZ8mdfn/NWY7vRZnxKjShJ1vGVunQiLkR cTnVia6l+PtjUiLvH7QQNnSHQCMQeJFpYlEDehWDQjnl/ucJwfmK+3V3ReVZK/J+1O FURi7fGp5I+E50DkEunGO/dGLT8zXi/7XnPWi/mo= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Joseph Qi , Heming Zhao , Mark Fasheh , Joel Becker , Junxiao Bi , Changwei Ge , Jun Piao , Andrew Morton , Sasha Levin Subject: [PATCH 6.12 844/869] ocfs2: use correct endian in ocfs2_dinode_has_extents Date: Sat, 17 Oct 2026 18:01:25 +0200 Message-ID: <20261017160058.506787973@linuxfoundation.org> X-Mailer: git-send-email 2.56.0 In-Reply-To: <20261017160036.979869304@linuxfoundation.org> References: <20261017160036.979869304@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.12-stable review patch. If anyone has any objections, please let me know. ------------------ From: Joseph Qi [ Upstream commit c9dff86eb78a4b6b02b1e407993c946ccaf9bfb4 ] Fields in ocfs2_dinode is little endian, covert to host endian when checking those contents. Link: https://lkml.kernel.org/r/20251025123218.3997866-1-joseph.qi@linux.alibaba.com Fixes: fdbb6cd96ed5 ("ocfs2: correct l_next_free_rec in online check") Signed-off-by: Joseph Qi Reviewed-by: Heming Zhao Cc: Mark Fasheh Cc: Joel Becker Cc: Junxiao Bi Cc: Changwei Ge Cc: Jun Piao Signed-off-by: Andrew Morton Signed-off-by: Sasha Levin --- fs/ocfs2/inode.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/fs/ocfs2/inode.c b/fs/ocfs2/inode.c index eb8de681376bd..ce78ef998217c 100644 --- a/fs/ocfs2/inode.c +++ b/fs/ocfs2/inode.c @@ -236,13 +236,15 @@ struct inode *ocfs2_iget(struct ocfs2_super *osb, u64 blkno, unsigned flags, static int ocfs2_dinode_has_extents(struct ocfs2_dinode *di) { /* inodes flagged with other stuff in id2 */ - if (di->i_flags & (OCFS2_SUPER_BLOCK_FL | OCFS2_LOCAL_ALLOC_FL | - OCFS2_CHAIN_FL | OCFS2_DEALLOC_FL)) + if (le32_to_cpu(di->i_flags) & + (OCFS2_SUPER_BLOCK_FL | OCFS2_LOCAL_ALLOC_FL | OCFS2_CHAIN_FL | + OCFS2_DEALLOC_FL)) return 0; /* i_flags doesn't indicate when id2 is a fast symlink */ - if (S_ISLNK(di->i_mode) && di->i_size && di->i_clusters == 0) + if (S_ISLNK(le16_to_cpu(di->i_mode)) && le64_to_cpu(di->i_size) && + !le32_to_cpu(di->i_clusters)) return 0; - if (di->i_dyn_features & OCFS2_INLINE_DATA_FL) + if (le16_to_cpu(di->i_dyn_features) & OCFS2_INLINE_DATA_FL) return 0; return 1; -- 2.53.0