.. | .. |
---|
482 | 482 | sector_t cur_block = io->block + b; |
---|
483 | 483 | struct ahash_request *req = verity_io_hash_req(v, io); |
---|
484 | 484 | |
---|
485 | | - if (v->validated_blocks && |
---|
| 485 | + if (v->validated_blocks && bio->bi_status == BLK_STS_OK && |
---|
486 | 486 | likely(test_bit(cur_block, v->validated_blocks))) { |
---|
487 | 487 | verity_bv_skip_block(v, io, &io->iter); |
---|
488 | 488 | continue; |
---|
.. | .. |
---|
538 | 538 | return -EIO; |
---|
539 | 539 | } |
---|
540 | 540 | if (verity_handle_err(v, DM_VERITY_BLOCK_TYPE_DATA, |
---|
541 | | - cur_block)) |
---|
| 541 | + cur_block)) |
---|
542 | 542 | return -EIO; |
---|
543 | 543 | } |
---|
544 | 544 | } |
---|
.. | .. |
---|
1219 | 1219 | goto bad; |
---|
1220 | 1220 | } |
---|
1221 | 1221 | |
---|
1222 | | - /* WQ_UNBOUND greatly improves performance when running on ramdisk */ |
---|
1223 | | - v->verify_wq = alloc_workqueue("kverityd", WQ_CPU_INTENSIVE | WQ_MEM_RECLAIM | WQ_UNBOUND, num_online_cpus()); |
---|
| 1222 | + /* |
---|
| 1223 | + * Using WQ_HIGHPRI improves throughput and completion latency by |
---|
| 1224 | + * reducing wait times when reading from a dm-verity device. |
---|
| 1225 | + * |
---|
| 1226 | + * Also as required for the "try_verify_in_tasklet" feature: WQ_HIGHPRI |
---|
| 1227 | + * allows verify_wq to preempt softirq since verification in tasklet |
---|
| 1228 | + * will fall-back to using it for error handling (or if the bufio cache |
---|
| 1229 | + * doesn't have required hashes). |
---|
| 1230 | + */ |
---|
| 1231 | + v->verify_wq = alloc_workqueue("kverityd", WQ_MEM_RECLAIM | WQ_HIGHPRI, 0); |
---|
1224 | 1232 | if (!v->verify_wq) { |
---|
1225 | 1233 | ti->error = "Cannot allocate workqueue"; |
---|
1226 | 1234 | r = -ENOMEM; |
---|