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 Cc: James Bottomley , Hannes Reinecke , Kay Sievers , SCSI development list , Andrew Morton , Greg Kroah-Hartman , Kernel development list , Tejun Heo , Cornelia Huck , , "Eric W. Biederman" To: Alan Stern Return-path: 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-fsdevel.vger.kernel.org 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