[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v4 07/31] s390: Fix error_append_hint/error_prepend usage
From: |
Markus Armbruster |
Subject: |
Re: [PATCH v4 07/31] s390: Fix error_append_hint/error_prepend usage |
Date: |
Wed, 09 Oct 2019 09:42:33 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/26.2 (gnu/linux) |
Vladimir Sementsov-Ogievskiy <address@hidden> writes:
> If we want to add some info to errp (by error_prepend() or
> error_append_hint()), we must use the ERRP_AUTO_PROPAGATE macro.
> Otherwise, this info will not be added when errp == &fatal_err
> (the program will exit prior to the error_append_hint() or
> error_prepend() call). Fix such cases.
>
> This commit (together with its neighbors) was generated by
>
> git grep -l 'error_\(append_hint\|prepend\)(errp' | while read f; do \
> spatch --sp-file scripts/coccinelle/fix-error-add-info.cocci \
> --in-place $f; done
Make that:
$ spatch --sp-file scripts/coccinelle/fix-error-add-info.cocci --macro-file
scripts/cocci-macro-file.h --in-place --no-show-diff `git grep -l
'error_\(append_hint\|prepend\)(errp' \*.[ch]`
Adding --macro-file is essential, as Eric noted. Without it, we miss
qcow2_store_persistent_dirty_bitmaps() in PATCH 23 and
nbd_negotiate_send_rep_verr() in PATCH 29. There should be a way to
make spatch warn when it gives up parsing, but I can't find it right
now.
Avoiding the loop is just for speed and simplicity.
--no-show-diff goes well with --in-place.
The even simpler
$ spatch --sp-file scripts/coccinelle/fix-error-add-info.cocci --macro-file
scripts/cocci-macro-file.h --in-place --no-show-diff --use-gitgrep
misses include/block/nbd.h's nbd_read() in PATCH 23 somehow.
I recommend to add the spatch invocation to the coccinelle script's
commit message, too [PATCH 05].
[...]