[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v4 23/31] block: Fix error_append_hint/error_prepend usage
From: |
Markus Armbruster |
Subject: |
Re: [PATCH v4 23/31] block: Fix error_append_hint/error_prepend usage |
Date: |
Wed, 09 Oct 2019 09:22:55 +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
>
> and then
>
> ./python/commit-per-subsystem.py MAINTAINERS "$(< auto-msg)"
>
> (auto-msg was a file with this commit message)
>
> and then by hand, for not maintained changed files:
>
> git commit -m "<SUB-SYSTEM>: $(< auto-msg)" <FILES>
>
> Still, for backporting it may be more comfortable to use only the first
> command and then do one huge commit.
>
> Reported-by: Greg Kurz <address@hidden>
> Signed-off-by: Vladimir Sementsov-Ogievskiy <address@hidden>
> ---
> include/block/nbd.h | 1 +
> block.c | 3 +++
> block/backup.c | 1 +
> block/dirty-bitmap.c | 1 +
> block/file-posix.c | 4 ++++
> block/gluster.c | 2 ++
> block/qcow.c | 1 +
> block/qcow2-bitmap.c | 1 +
> block/qcow2.c | 3 +++
> block/vdi.c | 1 +
> block/vhdx-log.c | 1 +
> block/vmdk.c | 1 +
> block/vpc.c | 1 +
> 13 files changed, 21 insertions(+)
>
> diff --git a/include/block/nbd.h b/include/block/nbd.h
> index 316fd705a9..330f40142a 100644
> --- a/include/block/nbd.h
> +++ b/include/block/nbd.h
> @@ -360,6 +360,7 @@ void nbd_server_start(SocketAddress *addr, const char
> *tls_creds,
> static inline int nbd_read(QIOChannel *ioc, void *buffer, size_t size,
> const char *desc, Error **errp)
> {
> + ERRP_AUTO_PROPAGATE();
> int ret = qio_channel_read_all(ioc, buffer, size, errp) < 0 ? -EIO : 0;
>
> if (ret < 0) {
This is an example of commit-per-subsystem.py producing a questionable
split. MAINTAINERS files include/block/nbd.h under both "Block layer
core" and "Network Block Device (NBD)". The script picks "Block layer
core" because it comes first.