From: Trond Myklebust Subject: Re: [PATCH] Backport inode_hash race fix Date: Mon, 3 Nov 2003 16:19:01 -0500 Sender: linux-fsdevel-owner@vger.kernel.org Message-ID: <16294.50757.170712.271692@charged.uio.no> References: <20030814151211.GA15650@ime.usp.br> <1067439222.16018.8.camel@hades.cambridge.redhat.com> <16289.58315.544796.134740@notabene.cse.unsw.edu.au> <16289.60912.741569.286152@notabene.cse.unsw.edu.au> Reply-To: trond.myklebust@fys.uio.no Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: David Woodhouse , Livio Baldini Soares , linux-fsdevel@vger.kernel.org, Andreas Dilger Return-path: Received: from pat.uio.no ([129.240.130.16]:29662 "EHLO pat.uio.no") by vger.kernel.org with ESMTP id S263478AbTKCVTR (ORCPT ); Mon, 3 Nov 2003 16:19:17 -0500 To: Neil Brown In-Reply-To: <16289.60912.741569.286152@notabene.cse.unsw.edu.au> List-Id: linux-fsdevel.vger.kernel.org >>>>> " " == Neil Brown writes: > With the suggested patch, an inode remains in the hash table > until after clear_inode, and is removed just before > destroy_inode. The 2.6 inode lookup code already copes with > finding an I_FREEING inode and will wait for it to complete > it's passage through the I_FREEING state before returning a > lookup failure (2.4 doesn't have that code yet, and needs it). > I don't think this issue can be addressed by a "proper test of > the flags in inode->i_state", but I'm willing to be educated. In the 2.6 version of generic_forget_inode(), a test is done on inode->i_state for whether or not the inode is dirty. If it is, a synchronous call to write_inode_now() is made before the inode is unhashed. Why should that sort of test be insufficient to prevent races? What processes are dirtying the inode after we set I_FREEING? Cheers, Trond