lkml.org 
[lkml]   [2003]   [May]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [PATCH] Graceful failure in devfs_remove() in 2.5.x
On Wed, 28 May 2003, Christoph Hellwig wrote:

> On Tue, May 27, 2003 at 11:29:53AM -0400, Pavel Roskin wrote:
> > This patch makes devfs_remove() print an error to the kernel log and
> > continue. PRINTK is defined in fs/devfs/base.c to report errors in the
> > cases like this one:
>
> Patch looks okay _except_ for use of this gross macro. Just
> ise plain printk instead.

I always try to follow the existing code style, but if you want me to make
an exception, here it is. Fixed patch is attached.

--
Regards,
Pavel Roskin--- linux.orig/fs/devfs/base.c
+++ linux/fs/devfs/base.c
@@ -1710,6 +1710,12 @@ void devfs_remove(const char *fmt, ...)
if (n < 64 && buf[0]) {
devfs_handle_t de = _devfs_find_entry(NULL, buf, 0);

+ if (!de) {
+ printk(KERN_ERR "%s: %s not found, cannot remove\n",
+ __FUNCTION__, buf);
+ return;
+ }
+
write_lock(&de->parent->u.dir.lock);
_devfs_unregister(de->parent, de);
devfs_put(de);
\
 
 \ /
  Last update: 2005-03-22 13:35    [W:0.050 / U:0.624 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site