From mboxrd@z Thu Jan 1 00:00:00 1970 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 1917953A7; Fri, 6 Dec 2024 15:21:27 +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=1733498489; cv=none; b=ss65sMqloMXhF6FH7sw+u2SvQkMV6rJagc6vUKjjodWb1evaG0PE/l95Ib2q4bEmlG97icyJNSbBUNAkcWKShgXb8Y4Ji+p2/XTbaLDtwxvBITcpBsgjTI+33/u1sQ+nAhKfvecEx4PhZuqYk8sbA/WEnqnRM66eMpYUXiww3H0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733498489; c=relaxed/simple; bh=gFR0BZxJgFuNBfeiLFEcN0XFpI+7RihnvGkgHVFmQ/k=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=KEC4kMhbzUtqSHCqoHg86hNYK36d3Pt39IWEHexPjYB2ChptwUsWDpfNUpiSiGQINspnI3iL142cAWwYrAfKcheVgM2z/SU6KuzmqOBeFTZ/HDLtFDK3EX07PmAkhVrnfbW1RHUrZBjWdnHbr8XUk8dDgATneOS3G2+qRaDOJTU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=jZLkYydl; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="jZLkYydl" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0DE59C4CED1; Fri, 6 Dec 2024 15:21:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1733498487; bh=gFR0BZxJgFuNBfeiLFEcN0XFpI+7RihnvGkgHVFmQ/k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jZLkYydlOinoAleM95Xdebj4mpeC/15wLlyWOf62dQBQwFCI6gvsM0iFW+9eOQ4p3 lBYEVCtTX/nOthezzBtn3S7P7QTVgLA86qxaNWwBI1qIzi8jXYInALIsIRomWxdAi5 xdrQ7vgOFN0SkUgWIRIHOhwqTZNhXQ4fRVaaGP1g= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Long Li , "Darrick J. Wong" , Christoph Hellwig , Carlos Maiolino , Sasha Levin Subject: [PATCH 6.6 600/676] xfs: remove unknown compat feature check in superblock write validation Date: Fri, 6 Dec 2024 15:36:59 +0100 Message-ID: <20241206143716.806743383@linuxfoundation.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20241206143653.344873888@linuxfoundation.org> References: <20241206143653.344873888@linuxfoundation.org> User-Agent: quilt/0.67 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.6-stable review patch. If anyone has any objections, please let me know. ------------------ From: Long Li [ Upstream commit 652f03db897ba24f9c4b269e254ccc6cc01ff1b7 ] Compat features are new features that older kernels can safely ignore, allowing read-write mounts without issues. The current sb write validation implementation returns -EFSCORRUPTED for unknown compat features, preventing filesystem write operations and contradicting the feature's definition. Additionally, if the mounted image is unclean, the log recovery may need to write to the superblock. Returning an error for unknown compat features during sb write validation can cause mount failures. Although XFS currently does not use compat feature flags, this issue affects current kernels' ability to mount images that may use compat feature flags in the future. Since superblock read validation already warns about unknown compat features, it's unnecessary to repeat this warning during write validation. Therefore, the relevant code in write validation is being removed. Fixes: 9e037cb7972f ("xfs: check for unknown v5 feature bits in superblock write verifier") Cc: stable@vger.kernel.org # v4.19+ Signed-off-by: Long Li Reviewed-by: Darrick J. Wong Reviewed-by: Christoph Hellwig Signed-off-by: Carlos Maiolino Signed-off-by: Sasha Levin --- fs/xfs/libxfs/xfs_sb.c | 7 ------- 1 file changed, 7 deletions(-) diff --git a/fs/xfs/libxfs/xfs_sb.c b/fs/xfs/libxfs/xfs_sb.c index 424acdd4b0fca..50dd27b0f2157 100644 --- a/fs/xfs/libxfs/xfs_sb.c +++ b/fs/xfs/libxfs/xfs_sb.c @@ -260,13 +260,6 @@ xfs_validate_sb_write( * the kernel cannot support since we checked for unsupported bits in * the read verifier, which means that memory is corrupt. */ - if (xfs_sb_has_compat_feature(sbp, XFS_SB_FEAT_COMPAT_UNKNOWN)) { - xfs_warn(mp, -"Corruption detected in superblock compatible features (0x%x)!", - (sbp->sb_features_compat & XFS_SB_FEAT_COMPAT_UNKNOWN)); - return -EFSCORRUPTED; - } - if (!xfs_is_readonly(mp) && xfs_sb_has_ro_compat_feature(sbp, XFS_SB_FEAT_RO_COMPAT_UNKNOWN)) { xfs_alert(mp, -- 2.43.0