From: Nick Piggin Subject: inotify_unmount_inodes badness? Date: Wed, 11 Mar 2009 04:46:07 +0100 Message-ID: <20090311034607.GG16561@wotan.suse.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii To: linux-fsdevel@vger.kernel.org Return-path: Received: from cantor.suse.de ([195.135.220.2]:40000 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753903AbZCKDqK (ORCPT ); Tue, 10 Mar 2009 23:46:10 -0400 Received: from Relay1.suse.de (mail2.suse.de [195.135.221.8]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.suse.de (Postfix) with ESMTP id 8D78445712 for ; Wed, 11 Mar 2009 04:46:07 +0100 (CET) Content-Disposition: inline Sender: linux-fsdevel-owner@vger.kernel.org List-ID: inotify_unmount_inodes does this hairly looking thing with list_for_each_entry_safe, where it tries to take a reference to the "next" inode as well as the current, before dropping inode_lock. But it doesn't take a reference on inodes without a refcount, or I_CLEAR|I_FREEING|I_WILL_FREE inodes before dropping the lock. Can't these guys just go away at any time? Why does it need the safe list traveral anyway (which is causing this complexity)? We don't remove the inode from its sb list here, do we??