aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md/bcache/io.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/md/bcache/io.c')
-rw-r--r--drivers/md/bcache/io.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/drivers/md/bcache/io.c b/drivers/md/bcache/io.c
index 7fac97ae036e..2ddf8515e6a5 100644
--- a/drivers/md/bcache/io.c
+++ b/drivers/md/bcache/io.c
@@ -52,7 +52,6 @@ void bch_submit_bbio(struct bio *bio, struct cache_set *c,
52/* IO errors */ 52/* IO errors */
53void bch_count_backing_io_errors(struct cached_dev *dc, struct bio *bio) 53void bch_count_backing_io_errors(struct cached_dev *dc, struct bio *bio)
54{ 54{
55 char buf[BDEVNAME_SIZE];
56 unsigned errors; 55 unsigned errors;
57 56
58 WARN_ONCE(!dc, "NULL pointer of struct cached_dev"); 57 WARN_ONCE(!dc, "NULL pointer of struct cached_dev");
@@ -60,7 +59,7 @@ void bch_count_backing_io_errors(struct cached_dev *dc, struct bio *bio)
60 errors = atomic_add_return(1, &dc->io_errors); 59 errors = atomic_add_return(1, &dc->io_errors);
61 if (errors < dc->error_limit) 60 if (errors < dc->error_limit)
62 pr_err("%s: IO error on backing device, unrecoverable", 61 pr_err("%s: IO error on backing device, unrecoverable",
63 bio_devname(bio, buf)); 62 dc->backing_dev_name);
64 else 63 else
65 bch_cached_dev_error(dc); 64 bch_cached_dev_error(dc);
66} 65}
@@ -105,19 +104,18 @@ void bch_count_io_errors(struct cache *ca,
105 } 104 }
106 105
107 if (error) { 106 if (error) {
108 char buf[BDEVNAME_SIZE];
109 unsigned errors = atomic_add_return(1 << IO_ERROR_SHIFT, 107 unsigned errors = atomic_add_return(1 << IO_ERROR_SHIFT,
110 &ca->io_errors); 108 &ca->io_errors);
111 errors >>= IO_ERROR_SHIFT; 109 errors >>= IO_ERROR_SHIFT;
112 110
113 if (errors < ca->set->error_limit) 111 if (errors < ca->set->error_limit)
114 pr_err("%s: IO error on %s%s", 112 pr_err("%s: IO error on %s%s",
115 bdevname(ca->bdev, buf), m, 113 ca->cache_dev_name, m,
116 is_read ? ", recovering." : "."); 114 is_read ? ", recovering." : ".");
117 else 115 else
118 bch_cache_set_error(ca->set, 116 bch_cache_set_error(ca->set,
119 "%s: too many IO errors %s", 117 "%s: too many IO errors %s",
120 bdevname(ca->bdev, buf), m); 118 ca->cache_dev_name, m);
121 } 119 }
122} 120}
123 121