From mboxrd@z Thu Jan 1 00:00:00 1970 From: "J. Bruce Fields" Subject: Re: [git pull] vfs and fs fixes Date: Tue, 17 Apr 2012 13:06:14 -0400 Message-ID: <20120417170614.GA29994@fieldses.org> References: <20120417052511.GU6589@ZenIV.linux.org.uk> <20120417162216.GB27426@fieldses.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: Al Viro , linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org To: Linus Torvalds Return-path: Received: from fieldses.org ([174.143.236.118]:49342 "EHLO fieldses.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754140Ab2DQRGQ (ORCPT ); Tue, 17 Apr 2012 13:06:16 -0400 Content-Disposition: inline In-Reply-To: Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Tue, Apr 17, 2012 at 09:33:06AM -0700, Linus Torvalds wrote: > On Tue, Apr 17, 2012 at 9:22 AM, J. Bruce Fields wrote: > > > > Ugh, no, I think you're right: > > > > =C2=A0 =C2=A0 =C2=A0 =C2=A0rename A/a->A/b > > =C2=A0 =C2=A0 =C2=A0 =C2=A0rename B/b->B/b > > > > where A/a and B/a are the same file, and A/b and B/b are the same f= ile, > > can result in the first rename holding the lock on A and a and wait= ing > > on b, and the second holding the lock on B and b and waiting on a. >=20 > In fact I don't think you need even that much. Just a simple >=20 > touch a > ln a b > mv a b >=20 > looks like it should deadlock on itself, no? source and dest inodes > will be the same, so the mutex_lock() will just deadlock without even > any ABBA race. >=20 > (I didn't really check - maybe there is some reason that doesn't happ= en). Yeah, rename has that funny exception that makes the above a no-op, so = I think that's safe. But the patch is still wrong; back to the drawing board. Maybe a paper bag over my head will help my concentration.... --b. -- To unsubscribe from this list: send the line "unsubscribe linux-fsdevel= " in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html