Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp203213imj; Thu, 14 Feb 2019 18:36:37 -0800 (PST) X-Google-Smtp-Source: AHgI3IZiH/jVdz7EsNdpi1ODJf23JIVxvHHOlHh+GspOyYVmNpI59A0pa1x5detMRnkbBv/+BvXp X-Received: by 2002:a63:d34a:: with SMTP id u10mr3135387pgi.301.1550198197485; Thu, 14 Feb 2019 18:36:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550198197; cv=none; d=google.com; s=arc-20160816; b=IrRf3paiW+WeE6wWMsHvQwVA+nV05Gyw76YRyfu/cb6+sN0y3ExYvZhIGzw1dVBf3P I2buZk3PRiTgfNRcUPaU4T4ZiSEgvtdnhP60M9eCLK25S/b6Vt/hEaWte5YLvVNi8cK0 BUzBfF6CKhCKAh/dNl6QnMH9+aRopUyXXOHJVHte4STPWq9MUySh5RKc+0pl6hPKcycV 6Z9rQdh9MfE4TnqiVCJgkTpKCP1KhPkneMp8WahM1x3wEbvvheAf7h+ZX1s/iLSuv6wB w+ZBbNcMY1Ws9Y51bD9QNjOQL4ygSYxBwIWoPn8fIbglS7rKMk2HexcVbQFexKqZDLpY 58QA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=FbjK01imgIQbfuGT+Pca7eV/Iab31UETe/uorT92hwg=; b=jS5URqnkLrhrRfIKxmBletV5Bo+ToUruKxrQpTgUijiCoAuSA2ZQZx35huWocwdzdx G82xX3Pks+EuX8n4rrS0hiAo4MNLBolaoxrDImU8xw4gnXmZ4q6OffPtiF+U9OhVCz9v BhJSAplUqw32uC4oCUDiq8kN0120T4BudXcfy7G4ToZgqUUtT2ee/OuRy03ryKSF5LQX Et4yzn1DvveX2gDZ+qbKLa02QoWhKOM6tfXYQ555+PcM3XIDQfng6K5/3tKa3rUHyrUI vQ/VocQxsASql2gbFgfwYJPtt6Zu5qc6IPBXlG+Yge7L0TKzzW2QXL0oIPQ37ws2dP/u XDdg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=BhWSoIL6; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o24si3805214pgv.224.2019.02.14.18.36.22; Thu, 14 Feb 2019 18:36:37 -0800 (PST) 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=@gmail.com header.s=20161025 header.b=BhWSoIL6; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730824AbfBOC1y (ORCPT + 99 others); Thu, 14 Feb 2019 21:27:54 -0500 Received: from mail-it1-f195.google.com ([209.85.166.195]:35604 "EHLO mail-it1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387829AbfBOC1w (ORCPT ); Thu, 14 Feb 2019 21:27:52 -0500 Received: by mail-it1-f195.google.com with SMTP id v72so19926066itc.0 for ; Thu, 14 Feb 2019 18:27:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=FbjK01imgIQbfuGT+Pca7eV/Iab31UETe/uorT92hwg=; b=BhWSoIL6ANsVEkRXDEHlGHLM60c7shqLl+bRbjRDJCA1HVWtKewz80+utw1mK2CN7S 4FwFyLmFdfVvkJRi6QjpTJsJn2FHAzm12EzDcqUv7cCp5A47LY5jlGImBckBXzH1V3TY Djg0f4+7W/D4Hl07EMkiBBOncAf423P3PANE9c4mvVnXlMc8XUSSydiyp3GLS2qYQ/xw IKiqPjXulA0ADB0XkAcq0pQnQYAsAgBGdwWTTkSN8QiHCDMFCvf73ttd3RgR3fQgrEQW 9ptewuWT70xOoo/+M0lT+QDRdMakRrb5R1YozpAoxnNaURUaCUlKadgA4yKZVErmZw9v pz1g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=FbjK01imgIQbfuGT+Pca7eV/Iab31UETe/uorT92hwg=; b=S+4CdL/e8UGAD8ny1f0HdMpRcZtEvhpIOMo2WGHKyJIyEPrrKLrvYhgyACuxqSZOk+ 2ux8To8n0vDnFWnUabPIU69g/XDqwNefrFPN6PDjnISOYhP3igcof9N4tUFBd6BNELTm 6wHJrsPJadZWwKYtV6l8we2Rfdlg30p/f6Pg/Base6x07Rgg//hgKeknnymHaPvzpKtT gXHS6cz+sOjVn5xfeQr7cPWZLxfRtLLMEpml7oXn/e+kl4tBq44OU9P/4E9sVgv2hb2y z7uaoMhyEmzz4yv15Ojsjnn4Fpk4QUYF8khAWPJeDV/Aec8OVLARiNDZc0uLyzq/4AAT pBlA== X-Gm-Message-State: AHQUAubnPLDimjM5MgDsybBsXyA7i1nbytz5QMj2KmRviq1qHg8+ZjhJ pd9Q8xNZEQN9dBIXwKgJF2QvIsVwxZc= X-Received: by 2002:a05:660c:1cc:: with SMTP id s12mr3666356itk.33.1550197670531; Thu, 14 Feb 2019 18:27:50 -0800 (PST) Received: from ubu-Virtual-Machine (66-188-57-61.dhcp.bycy.mi.charter.com. [66.188.57.61]) by smtp.gmail.com with ESMTPSA id p18sm126008itp.10.2019.02.14.18.27.49 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 14 Feb 2019 18:27:49 -0800 (PST) Date: Thu, 14 Feb 2019 21:27:47 -0500 From: Kimberly Brown To: Sasha Levin Cc: Dexuan Cui , Michael Kelley , Long Li , Stephen Hemminger , KY Srinivasan , Haiyang Zhang , "devel@linuxdriverproject.org" , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH] Drivers: hv: vmbus: Add mutex lock to channel show functions Message-ID: <20190215022747.GA53910@ubu-Virtual-Machine> References: <20190122064246.GA28613@ubu-Virtual-Machine> <20190128195845.GA3723@ubu-Virtual-Machine> <20190131151958.GT3973@sasha-vm> <20190131174707.GA2055@ubu-Virtual-Machine> <20190202200735.GA2637@ubu-Virtual-Machine> <20190215015431.GK69686@sasha-vm> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190215015431.GK69686@sasha-vm> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Feb 14, 2019 at 08:54:31PM -0500, Sasha Levin wrote: > On Sat, Feb 02, 2019 at 03:07:35PM -0500, Kimberly Brown wrote: > > On Fri, Feb 01, 2019 at 06:24:24PM +0000, Dexuan Cui wrote: > > > > From: Kimberly Brown > > > > Sent: Thursday, January 31, 2019 9:47 AM > > > > ... > > > > 2) Prevent a deadlock that can occur between the proposed mutex_lock() > > > > call in the vmbus_chan_attr_show() function and the sysfs/kernfs functions. > > > Hi Kim, > > > Can you please share more details about the deadlock? > > > It's unclear to me how the deadlock happens. > > > > > > > Hi Dexuan, > > > > I encountered the deadlock by: > > 1) Adding a call to msleep() before acquiring the mutex in > > vmbus_chan_attr_show() > > 2) Opening a hv_netvsc subchannel's sysfs file > > 3) Removing hv_netvsc while the sysfs file is opening > > Dexuan, any objections to pulling this fix in? > Hi Sasha, This fix can cause a deadlock. I'm working on a different fix for the original race condition problem. Thanks, Kim > -- > Thanks, > Sasha