From mboxrd@z Thu Jan 1 00:00:00 1970 From: ebiederm@xmission.com (Eric W. Biederman) Subject: Re: [PATCH 25/20] sysfs: Only support removing emtpy sysfs directories. Date: Thu, 28 May 2009 08:45:32 -0700 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from out02.mta.xmission.com ([166.70.13.232]:60236 "EHLO out02.mta.xmission.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752621AbZE1Ppn (ORCPT ); Thu, 28 May 2009 11:45:43 -0400 In-Reply-To: (Alan Stern's message of "Thu\, 28 May 2009 11\:24\:05 -0400 \(EDT\)") Sender: linux-scsi-owner@vger.kernel.org List-Id: linux-scsi@vger.kernel.org To: Alan Stern Cc: James Bottomley , Hannes Reinecke , Kay Sievers , SCSI development list , Andrew Morton , Greg Kroah-Hartman , Kernel development list , Tejun Heo , Cornelia Huck , linux-fsdevel@vger.kernel.org, "Eric W. Biederman" Alan Stern writes: > There's another point to consider. If you do accept my argument that > empty targets can be removed from visibility regardless of the host's > state, then this removal races with addition of a new child. Since > removal involves calling device_del(), it can't be protected by the > host lock. Instead we'd have to use a mutex to protect both target > addition and target removal. Careful. Holding a lock over device_del is an easy and hidden way to trigger a rare deadlocks. Eric