[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <alpine.DEB.2.00.1207091859280.25143@chino.kir.corp.google.com>
Date: Mon, 9 Jul 2012 19:01:04 -0700 (PDT)
From: David Rientjes <rientjes@...gle.com>
To: Wanpeng Li <liwp.linux@...il.com>
cc: Gavin Shan <shangw@...ux.vnet.ibm.com>, linux-mm@...ck.org,
Andrew Morton <akpm@...ux-foundation.org>,
William Irwin <wli@...omorphy.com>,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] mm/hugetlb: fix error code in hugetlbfs_alloc_inode
On Tue, 10 Jul 2012, Wanpeng Li wrote:
> >>diff --git a/fs/hugetlbfs/inode.c b/fs/hugetlbfs/inode.c
> >>index c4b85d0..79a0f33 100644
> >>--- a/fs/hugetlbfs/inode.c
> >>+++ b/fs/hugetlbfs/inode.c
> >>@@ -696,7 +696,7 @@ static struct inode *hugetlbfs_alloc_inode(struct super_block *sb)
> >> p = kmem_cache_alloc(hugetlbfs_inode_cachep, GFP_KERNEL);
> >> if (unlikely(!p)) {
> >> hugetlbfs_inc_free_inodes(sbinfo);
> >>- return NULL;
> >>+ return -ENOMEM;
> >
> >The function is expecting "struct inode *", man.
> >
> >static struct inode *hugetlbfs_alloc_inode(struct super_block *sb)
> >
> Hmm, replace it by ERR_PTR(-ENOMEM).
>
Please listen to the feedback you're getting before you reply.
This function is called by alloc_inode(). It tests whether the return
value is NULL or not, it doesn't check for PTR_ERR(). It's correct the
way it's written and you would have broken it.
In the future, please demonstrate how you've tested your patches before
proposing them.
--
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