From mboxrd@z Thu Jan 1 00:00:00 1970 From: Kevin Wolf Subject: Re: [RFC PATCH] kvm tools, qcow: Add support for growing refcount blocks Date: Mon, 12 Dec 2011 12:17:49 +0100 Message-ID: <4EE5E2DD.2070407@redhat.com> References: <1323655410-32000-1-git-send-email-tianyu.lan@intel.com> <4EE5CFA0.5000203@redhat.com> <4EE5E24D.20300@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit Cc: Lan Tianyu , kvm@vger.kernel.org, asias.hejun@gmail.com, levinsasha928@gmail.com, prasadjoshi124@gmail.com To: Pekka Enberg Return-path: Received: from mx1.redhat.com ([209.132.183.28]:23654 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751386Ab1LLLOk (ORCPT ); Mon, 12 Dec 2011 06:14:40 -0500 In-Reply-To: <4EE5E24D.20300@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: Am 12.12.2011 12:15, schrieb Kevin Wolf: > 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? Er, not sure what I was thinking, but it's the top 4k of the address space, which should be kernel memory. So I think you actually can be sure. Kevin