|
From: | Vladimir Sementsov-Ogievskiy |
Subject: | Re: [PATCH v3 12/13] block/qcow2: simplify qcow2_co_invalidate_cache() |
Date: | Tue, 20 Oct 2020 15:46:36 +0300 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.3.3 |
19.10.2020 16:06, Kevin Wolf wrote:
Am 16.10.2020 um 19:10 hat Vladimir Sementsov-Ogievskiy geschrieben:qcow2_do_open correctly sets errp on each failure path. So, we can simplify code in qcow2_co_invalidate_cache() and drop explicit error propagation.qcow2_update_options_prepare() can return -EINVAL without setting errp: if (s->crypt_method_header != QCOW_CRYPT_NONE && !r->crypto_opts) { ret = -EINVAL; goto fail; }
Actually, it's set in previous "switch", either in "default:" branch or if block_crypto_open_opts_init() failed.. But the code pattern is far from being obvious, I'll add a patch to refactor. -- Best regards, Vladimir
[Prev in Thread] | Current Thread | [Next in Thread] |