Received: by 10.213.65.68 with SMTP id h4csp129455imn; Wed, 21 Mar 2018 14:13:04 -0700 (PDT) X-Google-Smtp-Source: AG47ELsMuHSvmLLEf/xuhVyDTn4XC1m4HnF/691uNCy8nT33SdKgG8iabp/qcbgY8MvaA/Z2vAfS X-Received: by 2002:a17:902:227:: with SMTP id 36-v6mr21537912plc.134.1521666784130; Wed, 21 Mar 2018 14:13:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521666784; cv=none; d=google.com; s=arc-20160816; b=VUnlDUy2iwLtPWqeWqqA0TPj7qUUOcs2kVbxbtn94+NfgyHJjs56DSRx0YZa7hgwY5 IOJZLwxkU/RQfMaLA9CUMD5qxRxFr0gzd1rcTFIIk9Mb+cq4Dp1FpCjz8oiASoT/mtGt NdnebtyV1sm8Lo8At0n/GMzNNj2qhw5zkEFFzSHIoFMytAtjZ3b9EcfruaboFxb2l/Jp Ch6NOREnJKbuYb4Uo2X2r+L6cWLTM8nfNa8JQEnYEqZKKPF716l0t/dOiymGXNX2kLI4 Ufj0oFusHB0DMi6TMaxAmfzGHFOnye26U5kjrOrM3l2SptdcXji0FaiT9fvsoemxPfSM Xh8Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature :arc-authentication-results; bh=cichXeIOP6AIi7buphbai/x8EGoqP3rGSGYAPLgY8TE=; b=cw4rQPX95NjrpEGDViX0ZQl7cde2fmW45AhtKhm6UJwF2lXHFmLS0/mK95ccu5ZCQR 0mNavF+J8IbexiBQVHihWNkuUH6o+aUH0XkQyqwtvXAWl5YJ1O5oux7g41sZ5FbajHc9 bjTfoWkf35qwToRVu8IQvUHUOaB0imy87Tz3muK0eEgXOhaQyrTC4m/D48KYCmTdU/Ax U3sTUpe1kkR7TULQbmXdkNIbNcOg4JT9gQE3nG57zBSG6VTzhpkzYNvFciORZU/V8sun +DW/7NZXSRFZJyb/d+Fb55MmsQhBe1k7EW+nLT9BU7hZ9+AG7tAWMAVcyb0Cr1NBLOPQ DUcg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2017-10-26 header.b=P5hH3VxF; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n5si3327841pfi.360.2018.03.21.14.12.49; Wed, 21 Mar 2018 14:13:04 -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; dkim=pass header.i=@oracle.com header.s=corp-2017-10-26 header.b=P5hH3VxF; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753550AbeCUVLm (ORCPT + 99 others); Wed, 21 Mar 2018 17:11:42 -0400 Received: from aserp2130.oracle.com ([141.146.126.79]:52004 "EHLO aserp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753210AbeCUVLf (ORCPT ); Wed, 21 Mar 2018 17:11:35 -0400 Received: from pps.filterd (aserp2130.oracle.com [127.0.0.1]) by aserp2130.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w2LL3mWm004356; Wed, 21 Mar 2018 21:11:27 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=subject : to : cc : references : from : message-id : date : mime-version : in-reply-to : content-type : content-transfer-encoding; s=corp-2017-10-26; bh=cichXeIOP6AIi7buphbai/x8EGoqP3rGSGYAPLgY8TE=; b=P5hH3VxFGrJ6j+g120uUoKXMUM5Ueb9ASFJg55ck7/cD9f+5OUar5p8EWW4EvqlZw8k6 gnDnBgoqDYiAqib8c3nvWpmNbOkiLxm8tVZoqcYPAfAWY1mRt1tNIoHO3vzmm24Q6leo OwUCHd3Q6krjku4Q3fQ6zGiB3CRHipUC9tu5RMCCSClhfMgihRBmYvNgptXJdk7351YI IvWJjFZn6LI3VbGty9gk8yNlEfzyhkt4NK2v/nXLgyX7gwBFkqdQvaGMxvoj9vRfcj5l 4HhNCIJOYUMYSYMvDRIG9EEtIQvUHHr+AAL+axNO1Y2oKXIi56NtqP+GpENRNBD+h0Iw Mg== Received: from userv0022.oracle.com (userv0022.oracle.com [156.151.31.74]) by aserp2130.oracle.com with ESMTP id 2guxytr0u2-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 21 Mar 2018 21:11:27 +0000 Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by userv0022.oracle.com (8.14.4/8.14.4) with ESMTP id w2LLBQLI011960 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 21 Mar 2018 21:11:26 GMT Received: from abhmp0003.oracle.com (abhmp0003.oracle.com [141.146.116.9]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id w2LLBPce019222; Wed, 21 Mar 2018 21:11:25 GMT Received: from dhcp-burlington7-2nd-B-east-10-152-55-162.usdhcp.oraclecorp.com (/10.152.32.65) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Wed, 21 Mar 2018 14:11:25 -0700 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, Juergen Gross , linux-kernel@vger.kernel.org References: <20180315024322.27429-1-simon@invisiblethingslab.com> From: Boris Ostrovsky Message-ID: Date: Wed, 21 Mar 2018 17:13:21 -0400 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-Transfer-Encoding: 7bit Content-Language: en-US X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8839 signatures=668695 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1711220000 definitions=main-1803200127 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 03/14/2018 10:43 PM, 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 Applied the series to for-linus-4.17 -boris