From: Matthew Wilcox Subject: Re: [PATCH] fix hangs in posix_locks_deadlock(). Date: Mon, 20 Sep 2004 20:03:51 +0100 Sender: linux-fsdevel-owner@vger.kernel.org Message-ID: <20040920190351.GR642@parcelfarce.linux.theplanet.co.uk> References: <1095706707.7092.27.camel@lade.trondhjem.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Linus Torvalds , Andrew Morton , Linux Filesystem Development Return-path: Received: from parcelfarce.linux.theplanet.co.uk ([195.92.249.252]:58343 "EHLO www.linux.org.uk") by vger.kernel.org with ESMTP id S267235AbUITTDw (ORCPT ); Mon, 20 Sep 2004 15:03:52 -0400 To: Trond Myklebust Content-Disposition: inline In-Reply-To: <1095706707.7092.27.camel@lade.trondhjem.org> List-Id: linux-fsdevel.vger.kernel.org On Mon, Sep 20, 2004 at 11:58:28AM -0700, Trond Myklebust wrote: > "blocked_list" may contain both leases and flock locks in addition to > posix locks. It shouldn't. Take this patch instead. Index: linux-2.6/fs/locks.c =================================================================== RCS file: /var/cvs/linux-2.6/fs/locks.c,v retrieving revision 1.13 diff -u -p -r1.13 locks.c --- linux-2.6/fs/locks.c 13 Sep 2004 15:23:40 -0000 1.13 +++ linux-2.6/fs/locks.c 20 Sep 2004 19:02:57 -0000 @@ -463,7 +463,8 @@ static void locks_insert_block(struct fi } list_add_tail(&waiter->fl_block, &blocker->fl_block); waiter->fl_next = blocker; - list_add(&waiter->fl_link, &blocked_list); + if (IS_POSIX(blocker)) + list_add(&waiter->fl_link, &blocked_list); } /* Wake up processes blocked waiting for blocker. -- "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