2023-08-16 19:58:27

by Ghimiray, Himal Prasad

[permalink] [raw]
Subject: [PATCH 1/1] fault-inject: Include linux/types.h by default.

Functions should_fail_alloc_page, should_failslab, and __should_failslab
are declared irrespective of CONFIG_FAULT_INJECTION. These functions use
bool and gfp_t types, which are treated as unknown when
CONFIG_FAULT_INJECTION is disabled because the inclusion of linux/types.h
is missing.

Fixes: 6ff1cb355e62 ("[PATCH] fault-injection capabilities infrastructure")

Cc: Lucas De Marchi <[email protected]>
Cc: Rodrigo Vivi <[email protected]>
Cc: Badal Nilawar <[email protected]>
Cc: Akinobu Mita <[email protected]>
Cc: Jason Gunthorpe <[email protected]>
Cc: Jens Axboe <[email protected]>
Cc: Qi Zheng <[email protected]>
Cc: [email protected]
Signed-off-by: Himal Prasad Ghimiray <[email protected]>
---
include/linux/fault-inject.h | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/include/linux/fault-inject.h b/include/linux/fault-inject.h
index 481abf530b3c..f83ab2b6cd08 100644
--- a/include/linux/fault-inject.h
+++ b/include/linux/fault-inject.h
@@ -2,9 +2,10 @@
#ifndef _LINUX_FAULT_INJECT_H
#define _LINUX_FAULT_INJECT_H

+#include <linux/types.h>
+
#ifdef CONFIG_FAULT_INJECTION

-#include <linux/types.h>
#include <linux/debugfs.h>
#include <linux/configfs.h>
#include <linux/ratelimit.h>
--
2.25.1



2023-12-18 13:46:16

by Rodrigo Vivi

[permalink] [raw]
Subject: Re: [PATCH 1/1] fault-inject: Include linux/types.h by default.

On Wed, Aug 16, 2023 at 07:17:48PM +0530, Himal Prasad Ghimiray wrote:
> Functions should_fail_alloc_page, should_failslab, and __should_failslab
> are declared irrespective of CONFIG_FAULT_INJECTION. These functions use
> bool and gfp_t types, which are treated as unknown when
> CONFIG_FAULT_INJECTION is disabled because the inclusion of linux/types.h
> is missing.
>
> Fixes: 6ff1cb355e62 ("[PATCH] fault-injection capabilities infrastructure")

gentle ping on this one. we'd like to be able to include fault-inject.c
without adding extra includes that should be taken care by the
fault-inject.h itself.

>
> Cc: Lucas De Marchi <[email protected]>
> Cc: Rodrigo Vivi <[email protected]>
> Cc: Badal Nilawar <[email protected]>
> Cc: Akinobu Mita <[email protected]>
> Cc: Jason Gunthorpe <[email protected]>
> Cc: Jens Axboe <[email protected]>
> Cc: Qi Zheng <[email protected]>
> Cc: [email protected]

Cc: Andrew Morton <[email protected]>
Cc: Kefeng Wang <[email protected]>

> Signed-off-by: Himal Prasad Ghimiray <[email protected]>

Reviewed-by: Rodrigo Vivi <[email protected]>

> ---
> include/linux/fault-inject.h | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/include/linux/fault-inject.h b/include/linux/fault-inject.h
> index 481abf530b3c..f83ab2b6cd08 100644
> --- a/include/linux/fault-inject.h
> +++ b/include/linux/fault-inject.h
> @@ -2,9 +2,10 @@
> #ifndef _LINUX_FAULT_INJECT_H
> #define _LINUX_FAULT_INJECT_H
>
> +#include <linux/types.h>
> +
> #ifdef CONFIG_FAULT_INJECTION
>
> -#include <linux/types.h>
> #include <linux/debugfs.h>
> #include <linux/configfs.h>
> #include <linux/ratelimit.h>
> --
> 2.25.1
>

2023-12-18 18:12:29

by Lucas De Marchi

[permalink] [raw]
Subject: Re: [PATCH 1/1] fault-inject: Include linux/types.h by default.

+Andrew

On Wed, Aug 16, 2023 at 07:17:48PM +0530, Himal Prasad Ghimiray wrote:
>Functions should_fail_alloc_page, should_failslab, and __should_failslab
>are declared irrespective of CONFIG_FAULT_INJECTION. These functions use
>bool and gfp_t types, which are treated as unknown when
>CONFIG_FAULT_INJECTION is disabled because the inclusion of linux/types.h
>is missing.
>
>Fixes: 6ff1cb355e62 ("[PATCH] fault-injection capabilities infrastructure")
>
>Cc: Lucas De Marchi <[email protected]>
>Cc: Rodrigo Vivi <[email protected]>
>Cc: Badal Nilawar <[email protected]>
>Cc: Akinobu Mita <[email protected]>
>Cc: Jason Gunthorpe <[email protected]>
>Cc: Jens Axboe <[email protected]>
>Cc: Qi Zheng <[email protected]>
>Cc: [email protected]
>Signed-off-by: Himal Prasad Ghimiray <[email protected]>

Reviewed-by: Lucas De Marchi <[email protected]>

Andrew, could we take this through our drm-xe-next branch going to
drm-next if this looks good to you?

thanks
Lucas De Marchi