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 D897A1EABB8; Mon, 21 Oct 2024 10:36:44 +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=1729507005; cv=none; b=JU3QGCYKNcmOm4e1N4viDxMGxXW9Hyet0d+0geYzwgr/xmdKC/7jvjUehOET1RvPx/QRpPFVAPv6q06gj+DDRRiWR0Ei2BP7v+KlLJhpyHP+62qMY/DfTCQcPp3llMwBUWSAxy0BF7mRw/G7bwpuGBWItRn72s0w82zrqME6HoM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729507005; c=relaxed/simple; bh=BiKxkQLriqj0bgErBU0T/eFZWX1XYnaWiVYN22aK8jI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=koCrtyBcG2BDLXhHnEiE1yxv4uF5Bm4xtbg123zmoxDWWgYbnF4bboTVrLKPy2aycgrI6DJ0F9Nm+yV4FrnYWRasDOj1LnhBfHIbV443FFAxo/DnRW5n2vw2BHY4ryZ4ZQnAqN5QebMkFLmRs3Vjfo8dN7uZ16D6u3bmy+AqSkI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=O9Q3yOXu; 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="O9Q3yOXu" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 215FBC4CEC3; Mon, 21 Oct 2024 10:36:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1729507004; bh=BiKxkQLriqj0bgErBU0T/eFZWX1XYnaWiVYN22aK8jI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=O9Q3yOXu560G3q4+5rIsmndqmIn1yh8Wovo2sAMQNQ8bl+FqBp9rkv5jmS6NzED2V TFYiFnp+dZZlRq744shSN1ld0v+YWuQJFSNE1FFihyQcnMnmE4H9MwX7g6GrPu81ws hyiwjirReIVZCr42DAe68YI8qGGE/rkCbWuCPTaU= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, linux-xfs@vger.kernel.org, "Darrick J. Wong" , Christoph Hellwig , Catherine Hoang Subject: [PATCH 6.6 027/124] xfs: require XFS_SB_FEAT_INCOMPAT_LOG_XATTRS for attr log intent item recovery Date: Mon, 21 Oct 2024 12:23:51 +0200 Message-ID: <20241021102257.776439524@linuxfoundation.org> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241021102256.706334758@linuxfoundation.org> References: <20241021102256.706334758@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: "Darrick J. Wong" commit 8ef1d96a985e4dc07ffbd71bd7fc5604a80cc644 upstream. The XFS_SB_FEAT_INCOMPAT_LOG_XATTRS feature bit protects a filesystem from old kernels that do not know how to recover extended attribute log intent items. Make this check mandatory instead of a debugging assert. Fixes: fd920008784ea ("xfs: Set up infrastructure for log attribute replay") Signed-off-by: Darrick J. Wong Reviewed-by: Christoph Hellwig Signed-off-by: Catherine Hoang Acked-by: Darrick J. Wong Signed-off-by: Greg Kroah-Hartman --- fs/xfs/xfs_attr_item.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) --- a/fs/xfs/xfs_attr_item.c +++ b/fs/xfs/xfs_attr_item.c @@ -510,6 +510,9 @@ xfs_attri_validate( unsigned int op = attrp->alfi_op_flags & XFS_ATTRI_OP_FLAGS_TYPE_MASK; + if (!xfs_sb_version_haslogxattrs(&mp->m_sb)) + return false; + if (attrp->__pad != 0) return false; @@ -602,8 +605,6 @@ xfs_attri_item_recover( args->op_flags = XFS_DA_OP_RECOVERY | XFS_DA_OP_OKNOENT | XFS_DA_OP_LOGGED; - ASSERT(xfs_sb_version_haslogxattrs(&mp->m_sb)); - switch (attr->xattri_op_flags) { case XFS_ATTRI_OP_FLAGS_SET: case XFS_ATTRI_OP_FLAGS_REPLACE: