If a target uses dm_submit_bio_remap() it should set
ti->accounts_remapped_io.
Also, switch dm_start_io_acct() WARN_ON to WARN_ON_ONCE.
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
* Expect no possibility for race unless is_duplicate_bio.
*/
if (!clone || likely(!clone_to_tio(clone)->is_duplicate_bio)) {
- if (WARN_ON(io->was_accounted))
+ if (WARN_ON_ONCE(io->was_accounted))
return;
io->was_accounted = 1;
} else if (xchg(&io->was_accounted, 1) == 1)
struct dm_target_io *tio = clone_to_tio(clone);
struct dm_io *io = tio->io;
+ WARN_ON_ONCE(!tio->ti->accounts_remapped_io);
+
/* establish bio that will get submitted */
if (!tgt_clone)
tgt_clone = clone;