* [PATCH] btrfs: tree-checker: Allow error injection for tree-checker
@ 2019-04-24 7:22 Qu Wenruo
2019-04-24 17:32 ` David Sterba
2019-04-24 17:45 ` David Sterba
0 siblings, 2 replies; 7+ messages in thread
From: Qu Wenruo @ 2019-04-24 7:22 UTC (permalink / raw)
To: linux-btrfs
Allowing error injection for btrfs_check_leaf_full() and
btrfs_check_node() is useful to test the failure path of btrfs write
time tree check.
Signed-off-by: Qu Wenruo <wqu@suse.com>
---
fs/btrfs/tree-checker.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/fs/btrfs/tree-checker.c b/fs/btrfs/tree-checker.c
index b9dd2a6e133f..9c22a1fe38c1 100644
--- a/fs/btrfs/tree-checker.c
+++ b/fs/btrfs/tree-checker.c
@@ -15,6 +15,7 @@
* carefully reviewed otherwise so it does not prevent mount of valid images.
*/
+#include <linux/error-injection.h>
#include "ctree.h"
#include "tree-checker.h"
#include "disk-io.h"
@@ -942,6 +943,7 @@ int btrfs_check_leaf_full(struct extent_buffer *leaf)
{
return check_leaf(leaf, true);
}
+ALLOW_ERROR_INJECTION(btrfs_check_leaf_full, ERRNO);
int btrfs_check_leaf_relaxed(struct extent_buffer *leaf)
{
@@ -1005,3 +1007,4 @@ int btrfs_check_node(struct extent_buffer *node)
out:
return ret;
}
+ALLOW_ERROR_INJECTION(btrfs_check_node, ERRNO);
--
2.21.0
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH] btrfs: tree-checker: Allow error injection for tree-checker
2019-04-24 7:22 [PATCH] btrfs: tree-checker: Allow error injection for tree-checker Qu Wenruo
@ 2019-04-24 17:32 ` David Sterba
2019-04-24 17:45 ` David Sterba
1 sibling, 0 replies; 7+ messages in thread
From: David Sterba @ 2019-04-24 17:32 UTC (permalink / raw)
To: Qu Wenruo; +Cc: linux-btrfs
On Wed, Apr 24, 2019 at 03:22:53PM +0800, Qu Wenruo wrote:
> Allowing error injection for btrfs_check_leaf_full() and
> btrfs_check_node() is useful to test the failure path of btrfs write
> time tree check.
>
> Signed-off-by: Qu Wenruo <wqu@suse.com>
Added to misc-next, thanks.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] btrfs: tree-checker: Allow error injection for tree-checker
2019-04-24 7:22 [PATCH] btrfs: tree-checker: Allow error injection for tree-checker Qu Wenruo
2019-04-24 17:32 ` David Sterba
@ 2019-04-24 17:45 ` David Sterba
2019-04-25 0:30 ` Qu Wenruo
1 sibling, 1 reply; 7+ messages in thread
From: David Sterba @ 2019-04-24 17:45 UTC (permalink / raw)
To: Qu Wenruo; +Cc: linux-btrfs
On Wed, Apr 24, 2019 at 03:22:53PM +0800, Qu Wenruo wrote:
> Allowing error injection for btrfs_check_leaf_full() and
> btrfs_check_node() is useful to test the failure path of btrfs write
> time tree check.
>
> Signed-off-by: Qu Wenruo <wqu@suse.com>
Does not compile:
CC [M] fs/btrfs/tests/extent-map-tests.o
In file included from fs/btrfs/tree-checker.c:18:
./include/linux/error-injection.h:15:15: error: unknown type name ‘bool’
static inline bool within_error_injection_list(unsigned long addr)
^~~~
./include/linux/error-injection.h: In function ‘within_error_injection_list’:
./include/linux/error-injection.h:17:9: error: ‘false’ undeclared (first use in this function)
return false;
^~~~~
./include/linux/error-injection.h:17:9: note: each undeclared identifier is reported only once for each function it appears in
make[1]: *** [scripts/Makefile.build:275: fs/btrfs/tree-checker.o] Error 1
make[1]: *** Waiting for unfinished jobs....
make: *** [Makefile:1737: fs/btrfs/] Error 2
gcc is 8.3.1
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] btrfs: tree-checker: Allow error injection for tree-checker
2019-04-24 17:45 ` David Sterba
@ 2019-04-25 0:30 ` Qu Wenruo
2019-04-25 14:13 ` David Sterba
0 siblings, 1 reply; 7+ messages in thread
From: Qu Wenruo @ 2019-04-25 0:30 UTC (permalink / raw)
To: dsterba, Qu Wenruo, linux-btrfs
[-- Attachment #1.1: Type: text/plain, Size: 1893 bytes --]
On 2019/4/25 上午1:45, David Sterba wrote:
> On Wed, Apr 24, 2019 at 03:22:53PM +0800, Qu Wenruo wrote:
>> Allowing error injection for btrfs_check_leaf_full() and
>> btrfs_check_node() is useful to test the failure path of btrfs write
>> time tree check.
>>
>> Signed-off-by: Qu Wenruo <wqu@suse.com>
>
> Does not compile:
>
> CC [M] fs/btrfs/tests/extent-map-tests.o
> In file included from fs/btrfs/tree-checker.c:18:
> ./include/linux/error-injection.h:15:15: error: unknown type name ‘bool’
> static inline bool within_error_injection_list(unsigned long addr)
> ^~~~
> ./include/linux/error-injection.h: In function ‘within_error_injection_list’:
> ./include/linux/error-injection.h:17:9: error: ‘false’ undeclared (first use in this function)
> return false;
> ^~~~~
> ./include/linux/error-injection.h:17:9: note: each undeclared identifier is reported only once for each function it appears in
> make[1]: *** [scripts/Makefile.build:275: fs/btrfs/tree-checker.o] Error 1
> make[1]: *** Waiting for unfinished jobs....
> make: *** [Makefile:1737: fs/btrfs/] Error 2
Compiles without problem here using 8.2.1 gcc.
...
CC [M] fs/btrfs/check-integrity.o
CC [M] fs/btrfs/ref-verify.o
CC [M] fs/btrfs/tests/free-space-tests.o
CC [M] fs/btrfs/tests/extent-buffer-tests.o
CC [M] fs/btrfs/tests/btrfs-tests.o
CC [M] fs/btrfs/tests/extent-io-tests.o
CC [M] fs/btrfs/tests/inode-tests.o
CC [M] fs/btrfs/tests/qgroup-tests.o
CC [M] fs/btrfs/tests/free-space-tree-tests.o
CC [M] fs/btrfs/tests/extent-map-tests.o
LD [M] fs/btrfs/btrfs.o
Building modules, stage 2.
MODPOST 1 modules
CC fs/btrfs/btrfs.mod.o
LD [M] fs/btrfs/btrfs.ko
>
>
> gcc is 8.3.1
>
Upgrading to gcc 8.3.0, still passes.
Is that a regression in gcc 8.3.1?
Thanks,
Qu
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] btrfs: tree-checker: Allow error injection for tree-checker
2019-04-25 0:30 ` Qu Wenruo
@ 2019-04-25 14:13 ` David Sterba
2019-04-25 14:22 ` Qu Wenruo
0 siblings, 1 reply; 7+ messages in thread
From: David Sterba @ 2019-04-25 14:13 UTC (permalink / raw)
To: Qu Wenruo; +Cc: dsterba, Qu Wenruo, linux-btrfs
On Thu, Apr 25, 2019 at 08:30:38AM +0800, Qu Wenruo wrote:
>
>
> On 2019/4/25 上午1:45, David Sterba wrote:
> > On Wed, Apr 24, 2019 at 03:22:53PM +0800, Qu Wenruo wrote:
> >> Allowing error injection for btrfs_check_leaf_full() and
> >> btrfs_check_node() is useful to test the failure path of btrfs write
> >> time tree check.
> >>
> >> Signed-off-by: Qu Wenruo <wqu@suse.com>
> >
> > Does not compile:
> >
> > CC [M] fs/btrfs/tests/extent-map-tests.o
> > In file included from fs/btrfs/tree-checker.c:18:
> > ./include/linux/error-injection.h:15:15: error: unknown type name ‘bool’
> > static inline bool within_error_injection_list(unsigned long addr)
> > ^~~~
> > ./include/linux/error-injection.h: In function ‘within_error_injection_list’:
> > ./include/linux/error-injection.h:17:9: error: ‘false’ undeclared (first use in this function)
> > return false;
> > ^~~~~
> > ./include/linux/error-injection.h:17:9: note: each undeclared identifier is reported only once for each function it appears in
> > make[1]: *** [scripts/Makefile.build:275: fs/btrfs/tree-checker.o] Error 1
> > make[1]: *** Waiting for unfinished jobs....
> > make: *** [Makefile:1737: fs/btrfs/] Error 2
>
> Compiles without problem here using 8.2.1 gcc.
>
> ...
> CC [M] fs/btrfs/check-integrity.o
> CC [M] fs/btrfs/ref-verify.o
> CC [M] fs/btrfs/tests/free-space-tests.o
> CC [M] fs/btrfs/tests/extent-buffer-tests.o
> CC [M] fs/btrfs/tests/btrfs-tests.o
> CC [M] fs/btrfs/tests/extent-io-tests.o
> CC [M] fs/btrfs/tests/inode-tests.o
> CC [M] fs/btrfs/tests/qgroup-tests.o
> CC [M] fs/btrfs/tests/free-space-tree-tests.o
> CC [M] fs/btrfs/tests/extent-map-tests.o
> LD [M] fs/btrfs/btrfs.o
> Building modules, stage 2.
> MODPOST 1 modules
> CC fs/btrfs/btrfs.mod.o
> LD [M] fs/btrfs/btrfs.ko
>
> >
> >
> > gcc is 8.3.1
> >
>
> Upgrading to gcc 8.3.0, still passes.
>
> Is that a regression in gcc 8.3.1?
I don't think it's caused by compiler but config options. And the build
bot sees the compilation failure too, so it's not specific to my setup:
https://lists.01.org/pipermail/kbuild-all/2019-April/060303.html
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] btrfs: tree-checker: Allow error injection for tree-checker
2019-04-25 14:13 ` David Sterba
@ 2019-04-25 14:22 ` Qu Wenruo
2019-04-25 15:13 ` David Sterba
0 siblings, 1 reply; 7+ messages in thread
From: Qu Wenruo @ 2019-04-25 14:22 UTC (permalink / raw)
To: dsterba, Qu Wenruo, linux-btrfs
[-- Attachment #1.1: Type: text/plain, Size: 2525 bytes --]
On 2019/4/25 下午10:13, David Sterba wrote:
> On Thu, Apr 25, 2019 at 08:30:38AM +0800, Qu Wenruo wrote:
>>
>>
>> On 2019/4/25 上午1:45, David Sterba wrote:
>>> On Wed, Apr 24, 2019 at 03:22:53PM +0800, Qu Wenruo wrote:
>>>> Allowing error injection for btrfs_check_leaf_full() and
>>>> btrfs_check_node() is useful to test the failure path of btrfs write
>>>> time tree check.
>>>>
>>>> Signed-off-by: Qu Wenruo <wqu@suse.com>
>>>
>>> Does not compile:
>>>
>>> CC [M] fs/btrfs/tests/extent-map-tests.o
>>> In file included from fs/btrfs/tree-checker.c:18:
>>> ./include/linux/error-injection.h:15:15: error: unknown type name ‘bool’
>>> static inline bool within_error_injection_list(unsigned long addr)
>>> ^~~~
>>> ./include/linux/error-injection.h: In function ‘within_error_injection_list’:
>>> ./include/linux/error-injection.h:17:9: error: ‘false’ undeclared (first use in this function)
>>> return false;
>>> ^~~~~
>>> ./include/linux/error-injection.h:17:9: note: each undeclared identifier is reported only once for each function it appears in
>>> make[1]: *** [scripts/Makefile.build:275: fs/btrfs/tree-checker.o] Error 1
>>> make[1]: *** Waiting for unfinished jobs....
>>> make: *** [Makefile:1737: fs/btrfs/] Error 2
>>
>> Compiles without problem here using 8.2.1 gcc.
>>
>> ...
>> CC [M] fs/btrfs/check-integrity.o
>> CC [M] fs/btrfs/ref-verify.o
>> CC [M] fs/btrfs/tests/free-space-tests.o
>> CC [M] fs/btrfs/tests/extent-buffer-tests.o
>> CC [M] fs/btrfs/tests/btrfs-tests.o
>> CC [M] fs/btrfs/tests/extent-io-tests.o
>> CC [M] fs/btrfs/tests/inode-tests.o
>> CC [M] fs/btrfs/tests/qgroup-tests.o
>> CC [M] fs/btrfs/tests/free-space-tree-tests.o
>> CC [M] fs/btrfs/tests/extent-map-tests.o
>> LD [M] fs/btrfs/btrfs.o
>> Building modules, stage 2.
>> MODPOST 1 modules
>> CC fs/btrfs/btrfs.mod.o
>> LD [M] fs/btrfs/btrfs.ko
>>
>>>
>>>
>>> gcc is 8.3.1
>>>
>>
>> Upgrading to gcc 8.3.0, still passes.
>>
>> Is that a regression in gcc 8.3.1?
>
> I don't think it's caused by compiler but config options. And the build
> bot sees the compilation failure too, so it's not specific to my setup:
>
> https://lists.01.org/pipermail/kbuild-all/2019-April/060303.html
>
Got it reproduced, not sure why the config could affect this problem.
But the fix is always straightforward, include types for bool and stddef
for true/false.
Thanks,
Qu
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] btrfs: tree-checker: Allow error injection for tree-checker
2019-04-25 14:22 ` Qu Wenruo
@ 2019-04-25 15:13 ` David Sterba
0 siblings, 0 replies; 7+ messages in thread
From: David Sterba @ 2019-04-25 15:13 UTC (permalink / raw)
To: Qu Wenruo; +Cc: dsterba, Qu Wenruo, linux-btrfs
On Thu, Apr 25, 2019 at 10:22:30PM +0800, Qu Wenruo wrote:
>
>
> On 2019/4/25 下午10:13, David Sterba wrote:
> > On Thu, Apr 25, 2019 at 08:30:38AM +0800, Qu Wenruo wrote:
> >>
> >>
> >> On 2019/4/25 上午1:45, David Sterba wrote:
> >>> On Wed, Apr 24, 2019 at 03:22:53PM +0800, Qu Wenruo wrote:
> >>>> Allowing error injection for btrfs_check_leaf_full() and
> >>>> btrfs_check_node() is useful to test the failure path of btrfs write
> >>>> time tree check.
> >>>>
> >>>> Signed-off-by: Qu Wenruo <wqu@suse.com>
> >>>
> >>> Does not compile:
> >>>
> >>> CC [M] fs/btrfs/tests/extent-map-tests.o
> >>> In file included from fs/btrfs/tree-checker.c:18:
> >>> ./include/linux/error-injection.h:15:15: error: unknown type name ‘bool’
> >>> static inline bool within_error_injection_list(unsigned long addr)
> >>> ^~~~
> >>> ./include/linux/error-injection.h: In function ‘within_error_injection_list’:
> >>> ./include/linux/error-injection.h:17:9: error: ‘false’ undeclared (first use in this function)
> >>> return false;
> >>> ^~~~~
> >>> ./include/linux/error-injection.h:17:9: note: each undeclared identifier is reported only once for each function it appears in
> >>> make[1]: *** [scripts/Makefile.build:275: fs/btrfs/tree-checker.o] Error 1
> >>> make[1]: *** Waiting for unfinished jobs....
> >>> make: *** [Makefile:1737: fs/btrfs/] Error 2
> >>
> >> Compiles without problem here using 8.2.1 gcc.
> >>
> >> ...
> >> CC [M] fs/btrfs/check-integrity.o
> >> CC [M] fs/btrfs/ref-verify.o
> >> CC [M] fs/btrfs/tests/free-space-tests.o
> >> CC [M] fs/btrfs/tests/extent-buffer-tests.o
> >> CC [M] fs/btrfs/tests/btrfs-tests.o
> >> CC [M] fs/btrfs/tests/extent-io-tests.o
> >> CC [M] fs/btrfs/tests/inode-tests.o
> >> CC [M] fs/btrfs/tests/qgroup-tests.o
> >> CC [M] fs/btrfs/tests/free-space-tree-tests.o
> >> CC [M] fs/btrfs/tests/extent-map-tests.o
> >> LD [M] fs/btrfs/btrfs.o
> >> Building modules, stage 2.
> >> MODPOST 1 modules
> >> CC fs/btrfs/btrfs.mod.o
> >> LD [M] fs/btrfs/btrfs.ko
> >>
> >>>
> >>>
> >>> gcc is 8.3.1
> >>>
> >>
> >> Upgrading to gcc 8.3.0, still passes.
> >>
> >> Is that a regression in gcc 8.3.1?
> >
> > I don't think it's caused by compiler but config options. And the build
> > bot sees the compilation failure too, so it's not specific to my setup:
> >
> > https://lists.01.org/pipermail/kbuild-all/2019-April/060303.html
> >
>
> Got it reproduced, not sure why the config could affect this problem.
>
> But the fix is always straightforward, include types for bool and stddef
> for true/false.
As this is only a minor compilation issue, I'll add the includes so we
don't have to wait on the proper fix to land and you can use the
injection.
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2019-04-25 15:12 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-24 7:22 [PATCH] btrfs: tree-checker: Allow error injection for tree-checker Qu Wenruo
2019-04-24 17:32 ` David Sterba
2019-04-24 17:45 ` David Sterba
2019-04-25 0:30 ` Qu Wenruo
2019-04-25 14:13 ` David Sterba
2019-04-25 14:22 ` Qu Wenruo
2019-04-25 15:13 ` David Sterba
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.