public inbox for fstests@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] common/rc: remove useless _pgrep funcion
@ 2025-06-22 20:39 Zorro Lang
  2025-06-22 20:39 ` [PATCH 2/2] common/rc: _add_dmesg_filter returns when RESULT_DIR is null Zorro Lang
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Zorro Lang @ 2025-06-22 20:39 UTC (permalink / raw)
  To: fstests

The _pgrep() function isn't used anymore, remove it.

Signed-off-by: Zorro Lang <zlang@kernel.org>
---
 common/rc | 10 ----------
 1 file changed, 10 deletions(-)

diff --git a/common/rc b/common/rc
index fbab26b25..a27f87a0b 100644
--- a/common/rc
+++ b/common/rc
@@ -36,16 +36,6 @@ _pkill()
 	pkill "$@"
 }
 
-# Find only the test processes started by this test
-_pgrep()
-{
-	if [ "$FSTESTS_ISOL" = "setsid" ]; then
-		pgrep --session 0 "$@"
-	else
-		pgrep "$@"
-	fi
-}
-
 # Common execution handling for fsstress invocation.
 #
 # We need per-test fsstress binaries because of the way fsstress forks and
-- 
2.47.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 2/2] common/rc: _add_dmesg_filter returns when RESULT_DIR is null
  2025-06-22 20:39 [PATCH 1/2] common/rc: remove useless _pgrep funcion Zorro Lang
@ 2025-06-22 20:39 ` Zorro Lang
  2025-07-10 16:15   ` Darrick J. Wong
  2025-07-10 16:09 ` [PATCH 1/2] common/rc: remove useless _pgrep funcion Zorro Lang
  2025-07-10 16:14 ` Darrick J. Wong
  2 siblings, 1 reply; 5+ messages in thread
From: Zorro Lang @ 2025-06-22 20:39 UTC (permalink / raw)
  To: fstests

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@kernel.org>
---
 common/rc | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/common/rc b/common/rc
index a27f87a0b..549f42135 100644
--- a/common/rc
+++ b/common/rc
@@ -4800,6 +4800,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


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/2] common/rc: remove useless _pgrep funcion
  2025-06-22 20:39 [PATCH 1/2] common/rc: remove useless _pgrep funcion Zorro Lang
  2025-06-22 20:39 ` [PATCH 2/2] common/rc: _add_dmesg_filter returns when RESULT_DIR is null Zorro Lang
@ 2025-07-10 16:09 ` Zorro Lang
  2025-07-10 16:14 ` Darrick J. Wong
  2 siblings, 0 replies; 5+ messages in thread
From: Zorro Lang @ 2025-07-10 16:09 UTC (permalink / raw)
  To: fstests; +Cc: djwong

On Mon, Jun 23, 2025 at 04:39:46AM +0800, Zorro Lang wrote:
> The _pgrep() function isn't used anymore, remove it.
> 
> Signed-off-by: Zorro Lang <zlang@kernel.org>
> ---

Ping.

Could anyone help to give my 2 small patches a reviewing :)

Thanks,
Zorro

>  common/rc | 10 ----------
>  1 file changed, 10 deletions(-)
> 
> diff --git a/common/rc b/common/rc
> index fbab26b25..a27f87a0b 100644
> --- a/common/rc
> +++ b/common/rc
> @@ -36,16 +36,6 @@ _pkill()
>  	pkill "$@"
>  }
>  
> -# Find only the test processes started by this test
> -_pgrep()
> -{
> -	if [ "$FSTESTS_ISOL" = "setsid" ]; then
> -		pgrep --session 0 "$@"
> -	else
> -		pgrep "$@"
> -	fi
> -}
> -
>  # Common execution handling for fsstress invocation.
>  #
>  # We need per-test fsstress binaries because of the way fsstress forks and
> -- 
> 2.47.1
> 
> 


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/2] common/rc: remove useless _pgrep funcion
  2025-06-22 20:39 [PATCH 1/2] common/rc: remove useless _pgrep funcion Zorro Lang
  2025-06-22 20:39 ` [PATCH 2/2] common/rc: _add_dmesg_filter returns when RESULT_DIR is null Zorro Lang
  2025-07-10 16:09 ` [PATCH 1/2] common/rc: remove useless _pgrep funcion Zorro Lang
@ 2025-07-10 16:14 ` Darrick J. Wong
  2 siblings, 0 replies; 5+ messages in thread
From: Darrick J. Wong @ 2025-07-10 16:14 UTC (permalink / raw)
  To: Zorro Lang; +Cc: fstests

On Mon, Jun 23, 2025 at 04:39:46AM +0800, Zorro Lang wrote:
> The _pgrep() function isn't used anymore, remove it.
> 
> Signed-off-by: Zorro Lang <zlang@kernel.org>

Yeah, seems fine to me.
Reviewed-by: "Darrick J. Wong" <djwong@kernel.org>

--D

> ---
>  common/rc | 10 ----------
>  1 file changed, 10 deletions(-)
> 
> diff --git a/common/rc b/common/rc
> index fbab26b25..a27f87a0b 100644
> --- a/common/rc
> +++ b/common/rc
> @@ -36,16 +36,6 @@ _pkill()
>  	pkill "$@"
>  }
>  
> -# Find only the test processes started by this test
> -_pgrep()
> -{
> -	if [ "$FSTESTS_ISOL" = "setsid" ]; then
> -		pgrep --session 0 "$@"
> -	else
> -		pgrep "$@"
> -	fi
> -}
> -
>  # Common execution handling for fsstress invocation.
>  #
>  # We need per-test fsstress binaries because of the way fsstress forks and
> -- 
> 2.47.1
> 
> 

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 2/2] common/rc: _add_dmesg_filter returns when RESULT_DIR is null
  2025-06-22 20:39 ` [PATCH 2/2] common/rc: _add_dmesg_filter returns when RESULT_DIR is null Zorro Lang
@ 2025-07-10 16:15   ` Darrick J. Wong
  0 siblings, 0 replies; 5+ messages in thread
From: Darrick J. Wong @ 2025-07-10 16:15 UTC (permalink / raw)
  To: Zorro Lang; +Cc: fstests

On Mon, Jun 23, 2025 at 04:39:47AM +0800, Zorro Lang wrote:
> 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@kernel.org>

Looks good,
Reviewed-by: "Darrick J. Wong" <djwong@kernel.org>

--D

> ---
>  common/rc | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/common/rc b/common/rc
> index a27f87a0b..549f42135 100644
> --- a/common/rc
> +++ b/common/rc
> @@ -4800,6 +4800,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
> 
> 

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2025-07-10 16:15 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-22 20:39 [PATCH 1/2] common/rc: remove useless _pgrep funcion Zorro Lang
2025-06-22 20:39 ` [PATCH 2/2] common/rc: _add_dmesg_filter returns when RESULT_DIR is null Zorro Lang
2025-07-10 16:15   ` Darrick J. Wong
2025-07-10 16:09 ` [PATCH 1/2] common/rc: remove useless _pgrep funcion Zorro Lang
2025-07-10 16:14 ` Darrick J. Wong

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox