I always hit below error on a system with readonly rootfs: ++ _xfs_prepare_for_eio_shutdown /dev/loop0 ... ++ _add_dmesg_filter 'Internal error' ++ local 'regexp=Internal error' ++ local filter_file=/dmesg_filter ++ '[' '!' -e /dmesg_filter ']' ++ echo 'Internal error' ./common/rc: line 4716: /dmesg_filter: Read-only file system The RESULT_DIR is null, due to xfstests/check calls _test_mount and _scratch_mount before RESULT_DIR creation. And _test_mount does _prepare_for_eio_shutdown -> _xfs_prepare_for_eio_shutdown -> _add_dmesg_filter "Internal error" when RESULT_DIR is null. Signed-off-by: Zorro Lang <zlang@xxxxxxxxxx> --- common/rc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/common/rc b/common/rc index e51686389..01e89747d 100644 --- a/common/rc +++ b/common/rc @@ -4716,6 +4716,12 @@ _check_dmesg_filter() # Add a simple expression to the default dmesg filter _add_dmesg_filter() { + # This function might be called before having RESULT_DIR, do nothing + # if RESULT_DIR isn't created + if [ ! -d "${RESULT_DIR}" ];then + return 1 + fi + local regexp="$1" local filter_file="${RESULT_DIR}/dmesg_filter" -- 2.47.1