kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Kevin Wolf <kwolf@redhat.com>
To: Pekka Enberg <penberg@kernel.org>
Cc: Lan Tianyu <tianyu.lan@intel.com>,
	kvm@vger.kernel.org, asias.hejun@gmail.com,
	levinsasha928@gmail.com, prasadjoshi124@gmail.com
Subject: Re: [RFC PATCH] kvm tools, qcow: Add support for growing refcount blocks
Date: Mon, 12 Dec 2011 12:15:25 +0100	[thread overview]
Message-ID: <4EE5E24D.20300@redhat.com> (raw)
In-Reply-To: <alpine.LFD.2.02.1112121257150.7537@tux.localdomain>

Am 12.12.2011 11:58, schrieb Pekka Enberg:
> On Mon, 12 Dec 2011, Kevin Wolf wrote:
>>> @@ -667,14 +722,11 @@ static struct qcow_refcount_block *qcow_read_refcount_block(struct qcow *q, u64
>>>
>>>  	rft_idx = clust_idx >> (header->cluster_bits - QCOW_REFCOUNT_BLOCK_SHIFT);
>>>  	if (rft_idx >= rft->rf_size)
>>> -		return NULL;
>>> +		return (void *)-ENOSPC;
>>
>> Is this allowed style in kvm-tool? :-/
> 
> It needs to use ERR_PTR() and related macros but otherwise I don't see a 
> big problem with it.

Can you be sure that it never clashes with a valid allocation when you
use this in userspace?

But yes, at least using appropriate functions should be required. And
this means that you can't only check for -ENOSPC, but you need to check
for all possible error codes (IS_ERR_VALUE() I guess).

Kevin

  reply	other threads:[~2011-12-12 11:12 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-12  2:03 [RFC PATCH] kvm tools, qcow: Add support for growing refcount blocks Lan Tianyu
2011-12-12  9:55 ` Kevin Wolf
2011-12-12 10:58   ` Pekka Enberg
2011-12-12 11:15     ` Kevin Wolf [this message]
2011-12-12 11:17       ` Kevin Wolf
2011-12-13  3:41       ` lan,Tianyu
2011-12-13  8:57         ` Kevin Wolf
2011-12-13  9:14           ` Pekka Enberg
2011-12-14  1:22           ` lan,Tianyu
2011-12-13  3:16     ` lan,Tianyu
2011-12-13  9:13       ` Pekka Enberg
2011-12-13  3:05   ` lan,Tianyu
2011-12-13  9:03     ` Kevin Wolf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4EE5E24D.20300@redhat.com \
    --to=kwolf@redhat.com \
    --cc=asias.hejun@gmail.com \
    --cc=kvm@vger.kernel.org \
    --cc=levinsasha928@gmail.com \
    --cc=penberg@kernel.org \
    --cc=prasadjoshi124@gmail.com \
    --cc=tianyu.lan@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).