diff options
author | Lars Ellenberg <lars.ellenberg@linbit.com> | 2010-12-20 09:38:07 -0500 |
---|---|---|
committer | Philipp Reisner <philipp.reisner@linbit.com> | 2011-03-10 05:45:21 -0500 |
commit | 071942727824bab03b1a3f6b6eeb5b269697b333 (patch) | |
tree | c08c9595b4f4628b399abe5c8195bc6211aa13e1 /drivers | |
parent | 3f98688afc2ce0138fc88e272bdd128e1e0b0976 (diff) |
drbd: ratelimit io error messages
Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/block/drbd/drbd_worker.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/block/drbd/drbd_worker.c b/drivers/block/drbd/drbd_worker.c index 3df37e65c118..7bfeb79e7105 100644 --- a/drivers/block/drbd/drbd_worker.c +++ b/drivers/block/drbd/drbd_worker.c | |||
@@ -165,14 +165,15 @@ void drbd_endio_sec(struct bio *bio, int error) | |||
165 | int uptodate = bio_flagged(bio, BIO_UPTODATE); | 165 | int uptodate = bio_flagged(bio, BIO_UPTODATE); |
166 | int is_write = bio_data_dir(bio) == WRITE; | 166 | int is_write = bio_data_dir(bio) == WRITE; |
167 | 167 | ||
168 | if (error) | 168 | if (error && __ratelimit(&drbd_ratelimit_state)) |
169 | dev_warn(DEV, "%s: error=%d s=%llus\n", | 169 | dev_warn(DEV, "%s: error=%d s=%llus\n", |
170 | is_write ? "write" : "read", error, | 170 | is_write ? "write" : "read", error, |
171 | (unsigned long long)e->sector); | 171 | (unsigned long long)e->sector); |
172 | if (!error && !uptodate) { | 172 | if (!error && !uptodate) { |
173 | dev_warn(DEV, "%s: setting error to -EIO s=%llus\n", | 173 | if (__ratelimit(&drbd_ratelimit_state)) |
174 | is_write ? "write" : "read", | 174 | dev_warn(DEV, "%s: setting error to -EIO s=%llus\n", |
175 | (unsigned long long)e->sector); | 175 | is_write ? "write" : "read", |
176 | (unsigned long long)e->sector); | ||
176 | /* strange behavior of some lower level drivers... | 177 | /* strange behavior of some lower level drivers... |
177 | * fail the request by clearing the uptodate flag, | 178 | * fail the request by clearing the uptodate flag, |
178 | * but do not return any error?! */ | 179 | * but do not return any error?! */ |