Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp197383imj; Thu, 14 Feb 2019 18:28:57 -0800 (PST) X-Google-Smtp-Source: AHgI3Ib9a+EODBlDKYI2N7jKPy1Ok+PSkZ0htwk+BiEP4r2DKScm4MZRKVAuK+wwqpDAJpP5SXJf X-Received: by 2002:a62:e216:: with SMTP id a22mr7394932pfi.20.1550197737320; Thu, 14 Feb 2019 18:28:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550197737; cv=none; d=google.com; s=arc-20160816; b=nY03PQ1KDw+KktHnXMr7r9t0pLsW8HgjPf8OyN4wWN3+a2fbZunqwswuCwmmWLbEEq BJWdvlVnCjrj/OyKAvWHrO9U+WXecNOhQWCBXCjqLyQZT72QIohxeWSx8tKNfMBgST4w Elq0UKddhzMOHFw2spPzmJwcmdbR0hMJBZVu2WEX/y9PUrZVrkeuoDEpWZ8EGrt6CDVP 1T7Ygm6CxfgIVvl1dpUa2MzEyXRHMFfLH6S7p1C7EMVvzArfw1BUyCoQHYGrRklfKBFZ CUXvlBqFanNPFnxaZuQtMWnH8iTq6B3rYqiBxPWhAlPv+6mu6kIDi/YAL3eO3Q70F7G/ DF/A== 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=sZctXZ3iMiiEOmbwB5XNUGJOkyU0Oiyr3JpZ8jmmH64=; b=0qOuxC+WVd0cPjYwNfZdPhiqXBH6N6Yk8BOHDjc2xOIpiHdKFg1NYwfTiYKfusMx92 9Ag7AZY2/MPJDkJ+Ma2YbvrQqrOPDCUh5L5A8e57fWUbQ6V/jxsu3Ycnf5UV6DE5Wzva aE7kQ+ebCfcym4jWMiRuybdsvWYmXrf24C2RqDT92mt3aH9oPsjLr3jqObpHEeLLFq11 6DajKRHUGHsf7sQQt5p7UjwANJDWz1Ss67hRwb7/2lyta1eg/MQw2+LimPVMNJl08zSC l5rTgV2ZZMsQyP1bHK4hD27sVJ2XCUO3IYX5ZCI5B4IcAf/bQl6AOyIJ6W6pv5E8GFrO BXmA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=iasA3uim; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m8si2267300pgp.322.2019.02.14.18.28.41; Thu, 14 Feb 2019 18:28:57 -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=@kernel.org header.s=default header.b=iasA3uim; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731087AbfBOByd (ORCPT + 99 others); Thu, 14 Feb 2019 20:54:33 -0500 Received: from mail.kernel.org ([198.145.29.99]:40272 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729053AbfBOByd (ORCPT ); Thu, 14 Feb 2019 20:54:33 -0500 Received: from localhost (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 65CCE21934; Fri, 15 Feb 2019 01:54:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1550195672; bh=sZctXZ3iMiiEOmbwB5XNUGJOkyU0Oiyr3JpZ8jmmH64=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=iasA3uimkw2BKBa0vUjVOcH8Ht4jU1iqzUR0bxh0McGc6p0cg1H8Poe1C2yABwLL2 AjVijJx2kQwdFMXMWcejbawrtqrszaznEKw1FIIuZlkshyLaziS1l4TnHzZ1fMSwWp yDIRZRZlaTvTmpMGUpMeV/c21kGboZ+5+49QaTng= Date: Thu, 14 Feb 2019 20:54:31 -0500 From: Sasha Levin To: Kimberly Brown Cc: Dexuan Cui , Michael Kelley , Long Li , Sasha Levin , 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: <20190215015431.GK69686@sasha-vm> 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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <20190202200735.GA2637@ubu-Virtual-Machine> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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? -- Thanks, Sasha