int i, j = 0;
/* logic error: lba out-of-bounds. Ignore read request */
- if (!(blba + nr_secs < pblk->rl.nr_secs)) {
- WARN_ON("pblk: read lbas out of bounds\n");
+ if (blba + nr_secs >= pblk->rl.nr_secs) {
+ WARN(1, "pblk: read lbas out of bounds\n");
return;
}
sector_t lba = pblk_get_lba(bio);
/* logic error: lba out-of-bounds. Ignore read request */
- if (!(lba < pblk->rl.nr_secs)) {
- WARN_ON("pblk: read lba out of bounds\n");
+ if (lba >= pblk->rl.nr_secs) {
+ WARN(1, "pblk: read lba out of bounds\n");
return;
}
int valid_secs = 0;
/* logic error: lba out-of-bounds */
- if (!(lba < pblk->rl.nr_secs)) {
- WARN_ON("pblk: read lba out of bounds\n");
+ if (lba >= pblk->rl.nr_secs) {
+ WARN(1, "pblk: read lba out of bounds\n");
goto out;
}
if (le64_to_cpu(lba_list[i]) == ADDR_EMPTY) {
spin_lock(&line->lock);
if (test_and_set_bit(i, line->invalid_bitmap))
- WARN_ON_ONCE("pblk: rec. double invalidate:\n");
+ WARN_ONCE(1, "pblk: rec. double invalidate:\n");
else
line->vsc--;
spin_unlock(&line->lock);