From mboxrd@z Thu Jan 1 00:00:00 1970 From: Al Viro Subject: Re: [RFC PATCH] shrink_dcache_parent() deadlock Date: Mon, 9 Jan 2012 21:26:55 +0000 Message-ID: <20120109212654.GY23916@ZenIV.linux.org.uk> References: <87ipkl87m9.fsf@tucsk.pomaz.szeredi.hu> <20120109171639.GA9359@infradead.org> <20120109173010.GX23916@ZenIV.linux.org.uk> <20120109205907.GE4198@dastard> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Linus Torvalds , Christoph Hellwig , Miklos Szeredi , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, mgorman@suse.de, gregkh@suse.de, akpm@linux-foundation.org To: Dave Chinner Return-path: Content-Disposition: inline In-Reply-To: <20120109205907.GE4198@dastard> Sender: linux-kernel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org On Tue, Jan 10, 2012 at 07:59:07AM +1100, Dave Chinner wrote: > > Comments? > > Looks OK to me. OK, grabbed. And there's *more* fixes for obvious shite - by now I'm really sick and tired of what people are doing with failure exits; this morning catch just from looking through d_alloc_root() callers: isofs - inode leak ext4 - dentry leak + completely bogus handling of ext4_mb_init() failure (stuff that hadn't been allocated gets freed, stuff that was allocated isn't) ceph - d_alloc_root() can fail. NULL pointer derefs galore... ) Frankly, d_alloc_root() had been a bad API; it should've been doing iput() on allocation failure. I've added a trivial helper in the local tree (d_make_root(inode) - same as d_alloc_root(inode) and do iput(inode) if result turns out to be NULL). Looks like *all* callers of d_alloc_root() either turn out to be buggy or trivially convert to d_make_root(). With a lot of boilerplate crap removed... Hell knows... Originally I thought about leaving both side-by-side, but it really starts looking as if there's no reason to keep d_alloc_root() at all... I still have a couple of callers to check, though.