From: Matthew Wilcox Subject: Re: [PATCH] fix hangs in posix_locks_deadlock(). Date: Sun, 26 Sep 2004 01:38:42 +0100 Sender: linux-fsdevel-owner@vger.kernel.org Message-ID: <20040926003842.GJ16153@parcelfarce.linux.theplanet.co.uk> References: <1095706707.7092.27.camel@lade.trondhjem.org> <20040920190351.GR642@parcelfarce.linux.theplanet.co.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Trond Myklebust , Andrew Morton , Linux Filesystem Development Return-path: Received: from parcelfarce.linux.theplanet.co.uk ([195.92.249.252]:15290 "EHLO www.linux.org.uk") by vger.kernel.org with ESMTP id S269456AbUIZAin (ORCPT ); Sat, 25 Sep 2004 20:38:43 -0400 To: Linus Torvalds Content-Disposition: inline In-Reply-To: List-Id: linux-fsdevel.vger.kernel.org On Tue, Sep 21, 2004 at 04:59:45PM -0700, Linus Torvalds wrote: > This is a different thing, btw. > > Willy, when you do > > if (IS_POSIX(blocker)) > list_add(&waiter->fl_link, &blocked_list); > > note how the _blocker_ may be a POSIX lock, but the _blockee_ is not > necessarily. Oh, but it is, because POSIX locks and BSD locks don't block each other. > but on the whole I'd really like to get some clarification for what the > semantics are actually supposed to be. I'm inclined to apply Trond's patch > if only because it looks more sensible, but I'd rather see an > _explanation_ of the fighting patches, ok? Only POSIX locks check for deadlock. This is because BSD locks can't be atomically changed -- you have to release the lock you currently have before upgrading it. As I've noted before (but never posted a patch), we should probably stop checking for deadlock. POSIX says it's optional for an implementation to check for deadlock, and since the change to match on tgid, we can report a deadlock when none exists. Sorry for the delay in replying; Debian's mailserver got backlogged and only just handed me this mail. -- "Next the statesmen will invent cheap lies, putting the blame upon the nation that is attacked, and every man will be glad of those conscience-soothing falsities, and will diligently study them, and refuse to examine any refutations of them; and thus he will by and by convince himself that the war is just, and will thank God for the better sleep he enjoys after this process of grotesque self-deception." -- Mark Twain