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

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

 



On Sat, Aug 12, 2006 at 05:51:41PM -0700, Jeff Carr ([email protected]) 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
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux