From: Luben Tuikov <ltuikov@yahoo.com>
To: linux-scsi <linux-scsi@vger.kernel.org>
Subject: [PATCH 1/2] [SCSI] Print only a single message "rejecting I/O to device being removed"
Date: Fri, 3 Nov 2006 01:17:30 -0800 (PST) [thread overview]
Message-ID: <96894.60447.qm@web31813.mail.mud.yahoo.com> (raw)
... at device removal.
Signed-off-by: Luben Tuikov <ltuikov@yahoo.com>
---
drivers/scsi/scsi_lib.c | 10 +++++++---
drivers/scsi/scsi_scan.c | 1 +
include/scsi/scsi_device.h | 3 +++
3 files changed, 11 insertions(+), 3 deletions(-)
diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c
index 7b0f9a3..f0de7ca 100644
--- a/drivers/scsi/scsi_lib.c
+++ b/drivers/scsi/scsi_lib.c
@@ -1302,9 +1302,13 @@ static int scsi_prep_fn(struct request_q
if(specials_only == SDEV_QUIESCE ||
specials_only == SDEV_BLOCK)
goto defer;
-
- sdev_printk(KERN_ERR, sdev,
- "rejecting I/O to device being removed\n");
+
+ if (sdev->num_rej_messages > 0) {
+ sdev->num_rej_messages--;
+ sdev_printk(KERN_ERR, sdev,
+ "rejecting I/O to device "
+ "being removed\n");
+ }
goto kill;
}
diff --git a/drivers/scsi/scsi_scan.c b/drivers/scsi/scsi_scan.c
index 1a5474b..ad988df 100644
--- a/drivers/scsi/scsi_scan.c
+++ b/drivers/scsi/scsi_scan.c
@@ -223,6 +223,7 @@ static struct scsi_device *scsi_alloc_sd
INIT_LIST_HEAD(&sdev->cmd_list);
INIT_LIST_HEAD(&sdev->starved_entry);
spin_lock_init(&sdev->list_lock);
+ sdev->num_rej_messages = SCSI_DEV_NUM_REJ_MESSAGES;
sdev->sdev_gendev.parent = get_device(&starget->dev);
sdev->sdev_target = starget;
diff --git a/include/scsi/scsi_device.h b/include/scsi/scsi_device.h
index 895d212..4b0785c 100644
--- a/include/scsi/scsi_device.h
+++ b/include/scsi/scsi_device.h
@@ -140,6 +140,9 @@ struct scsi_device {
struct execute_work ew; /* used to get process context on put */
+#define SCSI_DEV_NUM_REJ_MESSAGES 1
+ int num_rej_messages;
+
enum scsi_device_state sdev_state;
unsigned long sdev_data[0];
} __attribute__((aligned(sizeof(unsigned long))));
--
1.4.3.3.g6cec
next reply other threads:[~2006-11-03 9:17 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-11-03 9:17 Luben Tuikov [this message]
2006-11-03 12:29 ` [PATCH 1/2] [SCSI] Print only a single message "rejecting I/O to device being removed" Jens Axboe
2006-11-04 19:51 ` Luben Tuikov
2006-11-05 11:36 ` Jens Axboe
2006-11-05 19:08 ` Luben Tuikov
2006-11-06 21:00 ` Jens Axboe
2006-11-06 22:16 ` James Bottomley
2006-11-07 7:45 ` Jens Axboe
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=96894.60447.qm@web31813.mail.mud.yahoo.com \
--to=ltuikov@yahoo.com \
--cc=linux-scsi@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.