From mboxrd@z Thu Jan 1 00:00:00 1970 From: Paolo Bonzini Subject: Re: [PATCH v1 1/1] KVM: add missing kvm_put_kvm in case of failure Date: Tue, 27 Jun 2017 15:57:23 +0200 Message-ID: References: <1498564636-20259-1-git-send-email-imbrenda@linux.vnet.ibm.com> <66c8737e-20f7-627f-a1dd-8139d3304959@redhat.com> <20170627135007.GG10672@ZenIV.linux.org.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Cc: Claudio Imbrenda , kvm@vger.kernel.org, linux-kernel@vger.kernel.org, borntraeger@de.ibm.com, frankja@linux.vnet.ibm.com To: Al Viro Return-path: Received: from mx1.redhat.com ([209.132.183.28]:46268 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751475AbdF0N5d (ORCPT ); Tue, 27 Jun 2017 09:57:33 -0400 In-Reply-To: <20170627135007.GG10672@ZenIV.linux.org.uk> Content-Language: en-US Sender: kvm-owner@vger.kernel.org List-ID: On 27/06/2017 15:50, Al Viro wrote: >> Queued, thanks. > It's broken. Look: once we are past the anon_inode_getfile(), the > reference we held on kvm is transferred into new struct file. After > that point we don't drop kvm - we drop file. And as long as that > file is held, it will keep holding what used to be our reference to > kvm. Once all references to file are gone, its ->release() will be > called and that's where kvm reference in it will be dropped. > > IOW, this patch introduces a double-put. Yup, I've noticed your other reply (hopefully would have noticed during regression testing). Thanks Al. Paolo