lkml.org 
[lkml]   [2006]   [Aug]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [take8 1/2] kevent: Core files.
On 08/11/06 01:40, Evgeniy Polyakov wrote:

> +/*
> + * Inode events.
> + */
> +#define KEVENT_INODE_CREATE 0x1
> +#define KEVENT_INODE_REMOVE 0x2

It would be useful to have gnome/kde notification when hard drives start
failing. There was some talk in the past about how to implement that
with kobjects. Perhaps you could add for this purpose:

#define KEVENT_BLOCK_CREATE 0x1
#define KEVENT_BLOCK_REMOVE 0x2
#define KEVENT_BLOCK_ERROR 0x4

AFAICT:
The conversation concluded this is the best way to handle ioerrors:

--- a/fs/buffer.c
+++ b/fs/buffer.c
@@ -108,6 +108,8 @@ static void buffer_io_error(struct buffe
printk(KERN_ERR "Buffer I/O error on device %s, logical block %Lu\n",
bdevname(bh->b_bdev, b),
(unsigned long long)bh->b_blocknr);
+
+ kevent_block_error(&bh->b_bdev->bd_disk->kobj);
}

/*
--- a/fs/direct-io.c
+++ b/fs/direct-io.c
@@ -252,8 +252,11 @@ static void finished_one_bio(struct dio
transferred = dio->i_size - offset;

/* check for error in completion path */
- if (dio->io_error)
+ if (dio->io_error) {
transferred = dio->io_error;
+ kevent_block_error(
+ &dio->bio->bi_bdev->bd_disk->kobj);
+ }

dio_complete(dio, offset, transferred);

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
\
 
 \ /
  Last update: 2006-08-13 02:53    [W:0.031 / U:0.608 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site