Re: [PATCH] add I/O error uevent for block devices

From: Andrew Morton
Date: Fri Feb 18 2005 - 04:48:21 EST


Kay Sievers <kay.sievers@xxxxxxxx> wrote:
>
> For HAL we want to get notified about I/O errors of block devices.
> This is especially useful for devices we are unable to poll and
> therefore can't know if something goes wrong here.
>
> Signed-off-by: David Zeuthen <david@xxxxxxxx>
> Signed-off-by: Kay Sievers <kay.sievers@xxxxxxxx>
>
> ===== fs/buffer.c 1.270 vs edited =====
> --- 1.270/fs/buffer.c 2005-01-21 06:02:13 +01:00
> +++ edited/fs/buffer.c 2005-02-17 22:56:05 +01:00
> @@ -105,6 +105,7 @@ 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);
> + kobject_uevent(&bh->b_bdev->bd_disk->kobj, KOBJ_IO_ERROR, NULL);
> }

- buffer_io_error() is called from interrupt context, and
kobject_uevent() does multiple GFP_KERNEL allocations. You'll need to
use kobject_uevent_atomic().

- the prink_ratelimit() fix in end_buffer_async_read() should be a
separate patch, really. I'll fix that up.

- there are numerous other places where an I/O error can be detected:
grep the tree for b_end_io and bio_end_io.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/