mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Robert Love <rml@novell.com>
To: John McCutchan <ttb@tentacle.dhs.org>
Cc: linux-kernel@vger.kernel.org, nautilus-list@gnome.org,
	gamin-list@gnome.org, viro@parcelfarce.linux.theplanet.co.uk
Subject: Re: [RFC][PATCH] inotify 0.9.2
Date: Mon, 20 Sep 2004 17:52:34 -0400	[thread overview]
Message-ID: <1095717155.5258.7.camel@betsy.boston.ximian.com> (raw)
In-Reply-To: <1095652572.23128.2.camel@vertex>

[-- Attachment #1: Type: text/plain, Size: 485 bytes --]

On Sun, 2004-09-19 at 23:56 -0400, John McCutchan wrote:

> I would appreciate design review, code review and testing.

Hi, John.

When you pass SLAB_PANIC to kmem_cache_create(), the slab layer will
panic the kernel and thus halt the machine.  So there is no reason to
check the return value.

We could remove the SLAB_PANIC, but I think that it makes sense, so
instead I removed the code checking the returns, saving a few bytes.

Patch is against your inotify patch.

	Robert Love


[-- Attachment #2: inotify-slab-panic-rml-2.6.9-rc2.patch --]
[-- Type: text/x-patch, Size: 1184 bytes --]

Signed-Off-By: Robert Love <rml@novell.com>

 drivers/char/inotify.c |   20 +++++++-------------
 1 files changed, 7 insertions(+), 13 deletions(-)

diff -urN linux-inotify/drivers/char/inotify.c linux/drivers/char/inotify.c
--- linux-inotify/drivers/char/inotify.c	2004-09-20 17:10:58.000000000 -0400
+++ linux/drivers/char/inotify.c	2004-09-20 17:33:03.369317992 -0400
@@ -942,19 +942,13 @@
 
 	inotify_debug_flags = INOTIFY_DEBUG_NONE;
 
-	watcher_cache = kmem_cache_create ("watcher_cache", 
-			sizeof(struct inotify_watcher), 0, SLAB_PANIC, NULL, NULL);
-
-	if (!watcher_cache) {
-		misc_deregister (&inotify_device);
-	}
-	kevent_cache = kmem_cache_create ("kevent_cache", 
-			sizeof(struct inotify_kernel_event), 0, SLAB_PANIC, NULL, NULL);
-
-	if (!kevent_cache) {
-		misc_deregister (&inotify_device);
-		kmem_cache_destroy (watcher_cache);
-	}
+	watcher_cache = kmem_cache_create ("watcher_cache",
+			sizeof(struct inotify_watcher), 0,
+			SLAB_PANIC, NULL, NULL);
+
+	kevent_cache = kmem_cache_create ("kevent_cache",
+			sizeof(struct inotify_kernel_event), 0,
+			SLAB_PANIC, NULL, NULL);
 
 	printk(KERN_ALERT "inotify 0.9.2 minor=%d\n", inotify_device.minor);
 out:

  reply	other threads:[~2004-09-20 21:53 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-09-20  3:56 John McCutchan
2004-09-20 21:52 ` Robert Love [this message]
2004-09-21  5:21 ` Robert Love
2004-09-21 15:34   ` Edgar Toernig
2004-09-21 15:43     ` Chris Friesen
2004-09-22  2:27       ` John McCutchan
2004-09-23  1:46         ` Ray Lee
2004-09-23  3:42           ` John McCutchan
2004-09-23  4:52             ` Ray Lee
2004-09-23  5:10               ` Robert Love
2004-09-23  5:29                 ` Ray Lee
2004-09-21 15:46     ` Robert Love
2004-09-21  5:26 ` Robert Love
2004-09-21  5:44 ` Robert Love
2004-09-21 16:04 ` Robert Love
2004-09-21 18:56   ` Robert Love
2004-09-21 20:55     ` Robert Love
2004-09-22  2:32     ` John McCutchan
2004-09-22  3:49       ` Robert Love

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1095717155.5258.7.camel@betsy.boston.ximian.com \
    --to=rml@novell.com \
    --cc=gamin-list@gnome.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nautilus-list@gnome.org \
    --cc=ttb@tentacle.dhs.org \
    --cc=viro@parcelfarce.linux.theplanet.co.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®