From patchwork Wed Jul 3 21:36:05 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Darrick J. Wong" X-Patchwork-Id: 13722811 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 AAB981849C4; Wed, 3 Jul 2024 21:36:06 +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=1720042566; cv=none; b=AztroaTb3n1pRrdxcD8RdqWjSgt1OeAj8VT48l27EF+DkvLmkAGWjoZVikWOlbgy9iXfMLjl+AhDZmRF3vhJ5NswpRKEd3/ToxSv8T/CwidQnzYuNvDmH9F7PByYfWtZyciWZn8hDm4ZmH3VnhVbJERc5OBT9ixkbBb4UfH/1+U= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720042566; c=relaxed/simple; bh=QuAoKBvjbxFmlEMeejkzt4/NH2ow5lYD6Q7HLlZhIL0=; h=Date:From:To:Cc:Subject:Message-ID:MIME-Version:Content-Type: Content-Disposition; b=NqkvHANxze906kjr1QoXummx4m2rKe4EpIVjuNnMOkzbaim10GBWPhhoRsugOAn0xPu3slAsYZcnNjEFdWZ+ziMssTd2SCw++lJ2q6qxAp8SCfR0LQVJ7QlXQpNhjrqgPosEmKpmf1P/hCg+8ZFpKgrc6u1v+cn1dkXcBYhPYn0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=qA2e95kD; 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="qA2e95kD" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3E4C3C2BD10; Wed, 3 Jul 2024 21:36:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1720042566; bh=QuAoKBvjbxFmlEMeejkzt4/NH2ow5lYD6Q7HLlZhIL0=; h=Date:From:To:Cc:Subject:From; b=qA2e95kDbFR2zewO5JBITD78m90V9hP4Ilf8xu4THn9irp8pFUCa+EuBSIlzeUL1q P9quD+xgcSqe3vK0B+DWYquv6oYSsSFgZwar1Tprvv053zyYro9L9ik76c/PyLzfqX sPLzxjK4DLMun3RiPbHSdiGziowsUmMd9WKgJLwrYo5Aa221tfpIcXVYhD4YHXWqVT SCIjYdKtx5JH/0DflnwoFsE0NA6Ey0zetoarTWiF//PJ2ULDsWNSP0slaFsHuc87xi BFyw3OGe+qR30RiYCBCx0QPWydyaeCOwYsvHbcjrWoorHrcAmvR+5Tj1FBjBNL5mN5 X1boAoBDNOIbg== Date: Wed, 3 Jul 2024 14:36:05 -0700 From: "Darrick J. Wong" To: Zorro Lang Cc: fstests , xfs Subject: [PATCH] xfs/444: fix agfl reset warning detection for small log buffers Message-ID: <20240703213605.GK103020@frogsfrogsfrogs> Precedence: bulk X-Mailing-List: fstests@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Disposition: inline From: Darrick J. Wong Collectively, the ten subtests in xfs/444 can generate a lot of kernel log data. If the amount of log data is enough to overflow the kernel log buffers, the AGFL reset warning generated by fix_start and fix_wrap might have been overwritten by subsequent log data. Fix this by checking for the reset warning after each test and only complaining if at the end if we have /never/ seen the warning. Found by running on a kernel configured with CONFIG_LOG_BUF_SHIFT=14 (16K). This happened to be a Raspberry Pi, but in principle this can happen to anyone. I'd never noticed this before because x86 helpfully sets it to 17 (128K) by default. Signed-off-by: Darrick J. Wong Reviewed-by: Christoph Hellwig --- tests/xfs/444 | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/tests/xfs/444 b/tests/xfs/444 index db7418c55d..cf78a9a1f0 100755 --- a/tests/xfs/444 +++ b/tests/xfs/444 @@ -58,6 +58,10 @@ dump_ag0() { _scratch_xfs_db -c 'sb 0' -c 'p' -c 'agf 0' -c 'p' -c 'agfl 0' -c 'p' } +# Did we get the kernel warning too? +warn_str='WARNING: Reset corrupted AGFL' +saw_agfl_reset_warning=0 + runtest() { cmd="$1" @@ -208,6 +212,8 @@ ENDL echo "FS REMOUNT" >> $seqres.full dump_ag0 > $tmp.remount 2> /dev/null diff -u $tmp.repair $tmp.remount >> $seqres.full + + _check_dmesg_for "${warn_str}" && ((saw_agfl_reset_warning++)) } runtest fix_end @@ -221,9 +227,11 @@ runtest bad_start runtest no_move runtest simple_move -# Did we get the kernel warning too? -warn_str='WARNING: Reset corrupted AGFL' -_check_dmesg_for "${warn_str}" || echo "Missing dmesg string \"${warn_str}\"." +# We must see the AGFL reset warning at least once. Collectively, the subtests +# can generate enough kernel log data to overflow the buffer, so we check for +# the warning after each subtest and summarize the output here. +((saw_agfl_reset_warning > 0)) || \ + echo "Missing dmesg string \"${warn_str}\"." # Now run the regular dmesg check, filtering out the agfl warning filter_agfl_reset_printk() {