Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758716AbYAPDmh (ORCPT ); Tue, 15 Jan 2008 22:42:37 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1756404AbYAPDm1 (ORCPT ); Tue, 15 Jan 2008 22:42:27 -0500 Received: from smtp2.linux-foundation.org ([207.189.120.14]:42481 "EHLO smtp2.linux-foundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755030AbYAPDm0 (ORCPT ); Tue, 15 Jan 2008 22:42:26 -0500 Date: Tue, 15 Jan 2008 19:41:58 -0800 (PST) From: Linus Torvalds To: Tejun Heo cc: Linux Kernel , Al Viro , Gabor Gombas , Greg KH , Dave Young , bluez-devel@lists.sourceforge.net Subject: Re: [PATCH 2.6.24-rc7 2/2] sysfs: fix bugs in sysfs_rename/move_dir() In-Reply-To: <478D75BD.1010805@gmail.com> Message-ID: References: <478D74A6.7000206@gmail.com> <478D75BD.1010805@gmail.com> User-Agent: Alpine 1.00 (LFD 882 2007-12-20) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1226 Lines: 34 On Wed, 16 Jan 2008, Tejun Heo wrote: > > * sysfs_move_dir() has an extra dput() on success path. Are you sure? How did this ever work? Also, looking at this, I think the "how did this ever work" question is answered by "it didn't", but I also think there are still serious problems there. Look at again: mutex_lock(&old_parent->d_inode->i_mutex); if (!mutex_trylock(&new_parent->d_inode->i_mutex)) { mutex_unlock(&old_parent->d_inode->i_mutex); goto again; } and wonder what happen sif old_parent == new_parent. Is that trying to avoid an ABBA deadlock? Normally you'd do it by ordering the locks, or by taking a third lock to guarantee serialization at a higher level (ie the "s_vfs_rename_mutex" on the VFS layer) I'd like to apply these two patches, but I really want to get more of an ack for them from somebody like Al, or at least more of an explanation for why it's all the right thing. Linus -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/