[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20120109212654.GY23916@ZenIV.linux.org.uk>
Date: Mon, 9 Jan 2012 21:26:55 +0000
From: Al Viro <viro@...IV.linux.org.uk>
To: Dave Chinner <david@...morbit.com>
Cc: Linus Torvalds <torvalds@...ux-foundation.org>,
Christoph Hellwig <hch@...radead.org>,
Miklos Szeredi <miklos@...redi.hu>,
linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org,
mgorman@...e.de, gregkh@...e.de, akpm@...ux-foundation.org
Subject: Re: [RFC PATCH] shrink_dcache_parent() deadlock
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.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists