[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 04/10] qcow2: Return 0/-errno in qcow2_alloc_clu
From: |
Christoph Hellwig |
Subject: |
Re: [Qemu-devel] [PATCH 04/10] qcow2: Return 0/-errno in qcow2_alloc_cluster_offset |
Date: |
Tue, 19 Jan 2010 13:02:41 +0100 |
User-agent: |
Mutt/1.3.28i |
On Tue, Jan 19, 2010 at 12:57:35PM +0100, Kevin Wolf wrote:
> It's needed to be able to distinguish between the case where the
> clusters are already allocated (0/NULL) and the case where the request
> depends on another one (0/non-NULL). This check previously used the
> return value (cluster_offset for success, 0 for failure) and I didn't
> want to overload m->cluster_offset with such a meaning. This is the
> change in the caller:
>
> /* Need to wait for another request? If so, we are done for now. */
> - if (!acb->cluster_offset && acb->l2meta.depends_on != NULL) {
> + if (acb->l2meta.nb_clusters == 0 && acb->l2meta.depends_on != NULL) {
>
> The alternative would have been to keep using the return value and
> hijack some errno value. This would possibly conflict with real
> read/write errors though, so I decided to leave the return value alone.
Ok, makes sense.
- [Qemu-devel] [PATCH 00/10] qcow2 error path fixes, Kevin Wolf, 2010/01/18
- [Qemu-devel] [PATCH 03/10] qcow2: Return 0/-errno in get_cluster_table, Kevin Wolf, 2010/01/18
- [Qemu-devel] [PATCH 06/10] qcow2: Fix error handling in grow_refcount_table, Kevin Wolf, 2010/01/18
- [Qemu-devel] [PATCH 07/10] qcow2: Improve error handling in update_refcount, Kevin Wolf, 2010/01/18
- [Qemu-devel] [PATCH 05/10] block: Return original error codes in bdrv_pread/write, Kevin Wolf, 2010/01/18
- [Qemu-devel] [PATCH 08/10] qcow2: Allow updating no refcounts, Kevin Wolf, 2010/01/18