Re: Common10 [12/20] Move sysfs_slab_add to common

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

 



On Sun, 5 Aug 2012, JoonSoo Kim wrote:

> Why not handle error case of sysfs_slab_add()?
> Before patch, it is handled.
> Is there any reason for that?

The kmem_cache creation was successful so its usable from the subsystem
that created the cache. Its just that the sysfs entry was not registered.

We could handle the failure with a syslog entry?
Index: linux-2.6/mm/slab_common.c
===================================================================
--- linux-2.6.orig/mm/slab_common.c	2012-08-08 10:52:30.023371373 -0500
+++ linux-2.6/mm/slab_common.c	2012-08-08 10:52:08.551323219 -0500
@@ -140,8 +140,13 @@ out:
 		return NULL;
 	}

-	if (s->refcount == 1)
-		sysfs_slab_add(s);
+	if (s->refcount == 1) {
+		err = sysfs_slab_add(s);
+		if (err)
+			printk(KERN_WARNING "kmem_cache_create(%s) failed to"
+				" create sysfs entry. Error %d\n",
+					name, err);
+	}

 	return s;
 }

--
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]