• Jens Axboe's avatar
    dm: fix inflight IO check · b7934ba4
    Jens Axboe authored
    After switching to percpu inflight counters, the inflight check
    is totally buggy. It's perfectly valid for some counters to be
    non-zero while having a total inflight IO count of 0, that's how
    these kinds of counters work (inc on one CPU, dec on another).
    Fix the md_in_flight() check to sum all counters before returning
    a false positive, potentially.
    
    While at it, remove the inflight read for IO completion. We don't
    need it, just wake anyone that's waiting for the IO count to drop
    to zero. The caller needs to re-check that value anyway when woken,
    which it does.
    
    Fixes: 6f757231 ("dm: remove the pending IO accounting")
    Acked-by: default avatarMike Snitzer <snitzer@redhat.com>
    Reported-by: default avatarChristoph Hellwig <hch@lst.de>
    Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
    b7934ba4
dm.c 73.1 KB