WARN_ONCE(!dc, "NULL pointer of struct cached_dev");
/* * Read-ahead requests on a degrading and recovering md raid * (e.g. raid6) device might be failured immediately by md * raid code, which is not a real hardware media failure. So * we shouldn't count failed REQ_RAHEAD bio to dc->io_errors.
*/ if (bio->bi_opf & REQ_RAHEAD) {
pr_warn_ratelimited("%pg: Read-ahead I/O failed on backing device, ignore\n",
dc->bdev); return;
}
errors = atomic_add_return(1, &dc->io_errors); if (errors < dc->error_limit)
pr_err("%pg: IO error on backing device, unrecoverable\n",
dc->bdev); else
bch_cached_dev_error(dc);
}
void bch_count_io_errors(struct cache *ca,
blk_status_t error, int is_read, constchar *m)
{ /* * The halflife of an error is: * log2(1/2)/log2(127/128) * refresh ~= 88 * refresh
*/
if (ca->set->error_decay) { unsignedint count = atomic_inc_return(&ca->io_count);
while (count > ca->set->error_decay) { unsignedint errors; unsignedint old = count; unsignedintnew = count - ca->set->error_decay;
/* * First we subtract refresh from count; each time we * successfully do so, we rescale the errors once:
*/
count = atomic_cmpxchg(&ca->io_count, old, new);
if (count == old) {
count = new;
errors = atomic_read(&ca->io_errors); do {
old = errors; new = ((uint64_t) errors * 127) / 128;
errors = atomic_cmpxchg(&ca->io_errors,
old, new);
} while (old != errors);
}
}
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.