From: Trond Myklebust Subject: VFS list corruption in fs/inode.c (2.4.x) Date: Fri, 26 Mar 2004 19:08:28 -0500 Sender: linux-fsdevel-owner@vger.kernel.org Message-ID: <1080346108.2729.128.camel@lade.trondhjem.org> Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit Return-path: Received: from dh132.citi.umich.edu ([141.211.133.132]:910 "EHLO lade.trondhjem.org") by vger.kernel.org with ESMTP id S261462AbUC0AI3 (ORCPT ); Fri, 26 Mar 2004 19:08:29 -0500 Received: from trondmy by lade.trondhjem.org with local (Exim 4.30) id 1B71NE-0001Wz-Mt for linux-fsdevel@vger.kernel.org; Fri, 26 Mar 2004 19:08:28 -0500 To: linux-fsdevel@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org Hi, Someone filed a 2.4.x bug in Bugzilla and via some wierd and tortuous path, the thing ended up on my plate... See the description in http://bugme.osdl.org/show_bug.cgi?id=2367 AFAICS the only case where a locked inode can be placed on the dirty list is in refile_inode(), which fails to lock the inode itself or to check for whether or not the inode already is locked... The problem is that the only thing that ever calls refile_inode() is remove_page_from_inode_queue(), which cannot lock inode... Fix would appear to be add a check to refile_inode() as per the appended patch. Does this look correct, Al? Cheers, Trond --- linux-2.4.26-up/fs/inode.c.orig 2004-03-19 17:12:46.000000000 -0500 +++ linux-2.4.26-up/fs/inode.c 2004-03-26 13:01:23.000000000 -0500 @@ -319,7 +319,8 @@ void refile_inode(struct inode *inode) if (!inode) return; spin_lock(&inode_lock); - __refile_inode(inode); + if (!(inode->i_state & I_LOCK)) + __refile_inode(inode); spin_unlock(&inode_lock); }