Re: [take8 1/2] kevent: Core files.

Evgeniy Polyakov
2006-08-13T09:04:54Z

On Sat, Aug 12, 2006 at 05:51:41PM -0700, Jeff Carr (basilarchia@gmail.com) wrote:
> 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

Do we want it to be on top of kobject (like in your patch), or based on
gendisk? I think the latter is better, since kobject reperesents almost
any kind of devices, so we will create noticeble overhead for those who
do not know about kevents.

> 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);

--
Evgeniy Polyakov