From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Morton Subject: Re: [patch]anon_inodes.c: fix error check in anon_inode_getfd Date: Wed, 26 Sep 2007 20:59:57 -0700 Message-ID: <20070926205957.54f49465.akpm@linux-foundation.org> References: <3d0408630709261930l730f5081n2391b236dd0efb71@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: linux-fsdevel@vger.kernel.org, Davide Libenzi To: "Yan Zheng" Return-path: Received: from smtp2.linux-foundation.org ([207.189.120.14]:60798 "EHLO smtp2.linux-foundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750712AbXI0EAE (ORCPT ); Thu, 27 Sep 2007 00:00:04 -0400 In-Reply-To: <3d0408630709261930l730f5081n2391b236dd0efb71@mail.gmail.com> Sender: linux-fsdevel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org On Thu, 27 Sep 2007 10:30:50 +0800 "Yan Zheng" wrote: > Hello, > > igrab return NULL on error. > > Signed-off-by: Yan Zheng > --- > diff -ur linux-2.6.23-rc8/fs/anon_inodes.c linux/fs/anon_inodes.c > --- linux-2.6.23-rc8/fs/anon_inodes.c 2007-09-27 10:05:07.000000000 +0800 > +++ linux/fs/anon_inodes.c 2007-09-27 10:18:26.000000000 +0800 > @@ -87,8 +87,8 @@ > return -ENFILE; > > inode = igrab(anon_inode_inode); > - if (IS_ERR(inode)) { > - error = PTR_ERR(inode); > + if (!inode) { > + error = -ENOENT; > goto err_put_filp; > } hm, does that code actually need to exist? igrab() is pretty expensive and that fs is permanently mounted anyway...