Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751490AbdF0N5k (ORCPT ); Tue, 27 Jun 2017 09:57:40 -0400 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 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 23C74C05B1E6 Authentication-Results: ext-mx08.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx08.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=pbonzini@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 23C74C05B1E6 Subject: Re: [PATCH v1 1/1] KVM: add missing kvm_put_kvm in case of failure To: Al Viro Cc: Claudio Imbrenda , kvm@vger.kernel.org, linux-kernel@vger.kernel.org, borntraeger@de.ibm.com, frankja@linux.vnet.ibm.com 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> From: Paolo Bonzini Message-ID: Date: Tue, 27 Jun 2017 15:57:23 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.0 MIME-Version: 1.0 In-Reply-To: <20170627135007.GG10672@ZenIV.linux.org.uk> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Tue, 27 Jun 2017 13:57:27 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 627 Lines: 17 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