All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kay Sievers <kay.sievers@vrfy.org>
To: linux-kernel@vger.kernel.org
Cc: Greg KH <greg@kroah.com>, David Zeuthen <david@fubar.dk>
Subject: [PATCH] add I/O error uevent for block devices
Date: Fri, 18 Feb 2005 09:33:16 +0100	[thread overview]
Message-ID: <20050218083316.GA6619@vrfy.org> (raw)

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@fubar.dk>
Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>

===== 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);
 }
 
 /*
@@ -550,7 +551,8 @@ static void end_buffer_async_read(struct
 		set_buffer_uptodate(bh);
 	} else {
 		clear_buffer_uptodate(bh);
-		buffer_io_error(bh);
+		if (printk_ratelimit())
+			buffer_io_error(bh);
 		SetPageError(page);
 	}
 
===== include/linux/kobject_uevent.h 1.6 vs edited =====
--- 1.6/include/linux/kobject_uevent.h	2004-11-08 20:43:30 +01:00
+++ edited/include/linux/kobject_uevent.h	2005-02-17 23:10:05 +01:00
@@ -29,6 +29,7 @@ enum kobject_action {
 	KOBJ_UMOUNT	= (__force kobject_action_t) 0x05,	/* umount event for block devices */
 	KOBJ_OFFLINE	= (__force kobject_action_t) 0x06,	/* offline event for hotplug devices */
 	KOBJ_ONLINE	= (__force kobject_action_t) 0x07,	/* online event for hotplug devices */
+	KOBJ_IO_ERROR	= (__force kobject_action_t) 0x08,	/* I/O error for devices */
 };
 
 
===== lib/kobject_uevent.c 1.18 vs edited =====
--- 1.18/lib/kobject_uevent.c	2005-01-08 06:44:13 +01:00
+++ edited/lib/kobject_uevent.c	2005-02-17 22:52:03 +01:00
@@ -44,6 +44,8 @@ static char *action_to_string(enum kobje
 		return "offline";
 	case KOBJ_ONLINE:
 		return "online";
+	case KOBJ_IO_ERROR:
+		return "io_error";
 	default:
 		return NULL;
 	}


             reply	other threads:[~2005-02-18  8:33 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-02-18  8:33 Kay Sievers [this message]
2005-02-18  9:46 ` [PATCH] add I/O error uevent for block devices Andrew Morton
2005-02-18 12:45   ` Kay Sievers
2005-02-18 19:02     ` Andrew Morton
2005-02-18 20:17       ` Kay Sievers
2005-02-18 20:41         ` Andrew Morton

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20050218083316.GA6619@vrfy.org \
    --to=kay.sievers@vrfy.org \
    --cc=david@fubar.dk \
    --cc=greg@kroah.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.