diff mbox series

[2/3] common/rc: Add _require_get_hugepagesize and fix _require_label_get_max

Message ID 05dbc4b37d77e03bc288feb07815f737efbf2abd.1612951443.git.riteshh@linux.ibm.com (mailing list archive)
State New, archived
Headers show
Series fstests: -I <n> CLI option and some random fixes | expand

Commit Message

Ritesh Harjani Feb. 11, 2021, 3:31 a.m. UTC
_notrun executed from a subshell $(cmd) won't exit it's parent.
Hence _require_*** functions shouldn't have below statements.
	dummy=$(_label_get_max)
Also add a function _require_get_hugepagesize(), since it seems the
intention of _get_hugepagesize() is to also '_notrun' when the hugepagesize
is not a valid number.

Signed-off-by: Ritesh Harjani <riteshh@linux.ibm.com>
---
 common/rc | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

--

Comments

Eryu Guan March 7, 2021, 4 p.m. UTC | #1
On Thu, Feb 11, 2021 at 09:01:45AM +0530, Ritesh Harjani wrote:
> _notrun executed from a subshell $(cmd) won't exit it's parent.
> Hence _require_*** functions shouldn't have below statements.
> 	dummy=$(_label_get_max)
> Also add a function _require_get_hugepagesize(), since it seems the
> intention of _get_hugepagesize() is to also '_notrun' when the hugepagesize
> is not a valid number.
> 
> Signed-off-by: Ritesh Harjani <riteshh@linux.ibm.com>
> ---
>  common/rc | 8 +++++++-
>  1 file changed, 7 insertions(+), 1 deletion(-)
> 
> diff --git a/common/rc b/common/rc
> index 649b1cfd884a..1831714198af 100644
> --- a/common/rc
> +++ b/common/rc
> @@ -175,6 +175,12 @@ _get_hugepagesize()
>  	echo $((hugepgsz * 1024))
>  }
> 
> +_require_get_hugepagesize()
> +{
> +	# Just a dummy for _notrun if hugepagesize is not supported
> +	_get_hugepagesize
> +}
> +

I think this hunk should be moved to patch 3.

Otherwise patch looks fine to me. And I applied patch 1 for next update,
thanks!

Eryu

>  _mount()
>  {
>      $MOUNT_PROG `_mount_ops_filter $*`
> @@ -4250,7 +4256,7 @@ _label_get_max()
>  _require_label_get_max()
>  {
>  	# Just call _label_get_max which will notrun if appropriate
> -	dummy=$(_label_get_max)
> +	_label_get_max
>  }
> 
>  _dmsetup_remove()
> --
diff mbox series

Patch

diff --git a/common/rc b/common/rc
index 649b1cfd884a..1831714198af 100644
--- a/common/rc
+++ b/common/rc
@@ -175,6 +175,12 @@  _get_hugepagesize()
 	echo $((hugepgsz * 1024))
 }

+_require_get_hugepagesize()
+{
+	# Just a dummy for _notrun if hugepagesize is not supported
+	_get_hugepagesize
+}
+
 _mount()
 {
     $MOUNT_PROG `_mount_ops_filter $*`
@@ -4250,7 +4256,7 @@  _label_get_max()
 _require_label_get_max()
 {
 	# Just call _label_get_max which will notrun if appropriate
-	dummy=$(_label_get_max)
+	_label_get_max
 }

 _dmsetup_remove()