common/rc: _add_dmesg_filter returns when RESULT_DIR is null
PATCH 1/1 common/rc: _add_dmesg_filter returns when RESULT_DIR is null
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.
--- common/rc | 6 ++++++ 1 file changed, 6 insertions(+)
common/rc +6 -0
@@ -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"
Signature · 1 line
2.47.1
Quoted 11 lines · Zorro Lang
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
Quoted 7 lines
The
RESULT_DIRis null, due to xfstests/check calls_test_mountand_scratch_mountbeforeRESULT_DIRcreation. And_test_mountdoes_prepare_for_eio_shutdown->_xfs_prepare_for_eio_shutdown->_add_dmesg_filter"Internal error" whenRESULT_DIRis null.Signed-off-by Zorro Lang <[email protected]>---
ping, any review points about this patch?
Thanks,
Zorro
Quoted 24 lines
common/rc | 6 ++++++ 1 file changed, 6 insertions(+)common/rc +6
-0@@ -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"Signature · 1 line
2.47.1