Received: by 10.213.65.68 with SMTP id h4csp1568523imn; Thu, 15 Mar 2018 03:34:46 -0700 (PDT) X-Google-Smtp-Source: AG47ELv7aSVOhxQorX/XAYEj+fqrr3AeM1BuoE5TTdsIQjTi+e8PR4gfL2poY5LSXtVGQU5MhfJ6 X-Received: by 2002:a17:902:4601:: with SMTP id o1-v6mr7519324pld.210.1521110086233; Thu, 15 Mar 2018 03:34:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521110086; cv=none; d=google.com; s=arc-20160816; b=pClt+AdUy3vNeLK48xe2prUGscJJjMZGw4rZlc3YXswIMybphKfY9rl7cmjJHVenWx 58eSAC8SwS5WF1IR/3wcaUqflQwXZMrXw3Uc8rCZ5fzIse0dnKfBaNewx2db5mRVPjkz nGkd0VyiSGkSmz3srEkcZqS4tOtDQ6jpjwftcILGjCaNhGIhnt0hFldiupMxDs508PCH nTZN1dMgyvIp3U/kmDWYdyDbniojjuA9jbcYxVi1G6BHN2rO/Cyov4ewbgNR8trLZfb/ j3SyQ+Pcw65ZWZDu/d7Xo7QNiHhQOo97CbEhGeuMrXGELGy2ARey0BgqLaO6Vs6SWg6O b9/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:arc-authentication-results; bh=dS6V5zy3R7KE2+3Wh0cjrTMEHtJf2GKXbKw9CNB/SJ4=; b=RCD0gWVdYjCMJ2w04k05OzuN9izJM7+Dlcg9q+SHPsbeo3HTai4Y8mCuMkihYihwBm Qqqojd3jNMZfAcE9luhCDekLJohPVanmTt2f3GJ/L8Eij5m5rpUt8oFMtKX5VPvk7+ey otmrDfn1/qINIEjvXjRHlEVohH9k9vAryDHfv6OhI6gzculihpkILINn4qrDs21laYjD Os1qEjvbl4JBrRdSqxR0wBcTw317tv9Xey+ijO6KkWrep5ueMq4+FuGZ2ToxxVoxMvtx ORChh7zOb2NbWj4bjJ0YQwuXTiit4wj4xb246ylswAbr3cL7zgb3VWNqG49jSjOdECwx zZIQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k11si3272211pgq.0.2018.03.15.03.34.31; Thu, 15 Mar 2018 03:34:46 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751619AbeCOKdk (ORCPT + 99 others); Thu, 15 Mar 2018 06:33:40 -0400 Received: from mx2.suse.de ([195.135.220.15]:53895 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751467AbeCOKdi (ORCPT ); Thu, 15 Mar 2018 06:33:38 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 67C73AF91; Thu, 15 Mar 2018 10:33:37 +0000 (UTC) Subject: Re: [PATCH v2 1/3] xen: xenbus_dev_frontend: Fix XS_TRANSACTION_END handling To: Simon Gaiser , xen-devel@lists.xenproject.org Cc: stable@vger.kernel.org, Boris Ostrovsky , linux-kernel@vger.kernel.org References: <20180315024322.27429-1-simon@invisiblethingslab.com> From: Juergen Gross Message-ID: <3e626882-eac6-12db-9f5e-a75994bbdf2d@suse.com> Date: Thu, 15 Mar 2018 11:33:36 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <20180315024322.27429-1-simon@invisiblethingslab.com> Content-Type: text/plain; charset=utf-8 Content-Language: de-DE Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 15/03/18 03:43, Simon Gaiser wrote: > Commit fd8aa9095a95 ("xen: optimize xenbus driver for multiple > concurrent xenstore accesses") made a subtle change to the semantic of > xenbus_dev_request_and_reply() and xenbus_transaction_end(). > > Before on an error response to XS_TRANSACTION_END > xenbus_dev_request_and_reply() would not decrement the active > transaction counter. But xenbus_transaction_end() has always counted the > transaction as finished regardless of the response. > > The new behavior is that xenbus_dev_request_and_reply() and > xenbus_transaction_end() will always count the transaction as finished > regardless the response code (handled in xs_request_exit()). > > But xenbus_dev_frontend tries to end a transaction on closing of the > device if the XS_TRANSACTION_END failed before. Trying to close the > transaction twice corrupts the reference count. So fix this by also > considering a transaction closed if we have sent XS_TRANSACTION_END once > regardless of the return code. > > Cc: # 4.11 > Fixes: fd8aa9095a95 ("xen: optimize xenbus driver for multiple concurrent xenstore accesses") > Signed-off-by: Simon Gaiser Reviewed-by: Juergen Gross Juergen