Re: [PATCH RESEND] slub: return correct error on slab_sysfs_init

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 19 Jun 2014, Andrew Morton wrote:

> > > Why?  kset_create_and_add() can fail for a few other reasons other than
> > > memory constraints and given that this is only done at bootstrap, it
> > > actually seems like a duplicate name would be a bigger concern than low on
> > > memory if another init call actually registered it.
> > 
> > Greg said that the only reason for failure would be out of memory.
> 
> The kset_create_and_add interface is busted - it should return an
> ERR_PTR on error, not NULL.  This seems to be a common gregkh failing :(
> 
> It's plausible that out-of-memory is the most common reason for
> kset_create_and_add() failure, dunno.
> 

I seriously doubt out of memory issues are the most common reason for 
failure since this is only done at init, it seems much more likely that 
someone accidently added an object of the same name, "slab", erroneous and 
then -ENOMEM wouldn't make any sense.  kset_create_and_add() can most 
certainly return other errors rather than just -ENOMEM.

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@xxxxxxxxx.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@xxxxxxxxx";> email@xxxxxxxxx </a>




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]