• Mike Snitzer's avatar
    dm: fix double accounting of flush with data · 8d394bc4
    Mike Snitzer authored
    DM handles a flush with data by first issuing an empty flush and then
    once it completes the REQ_PREFLUSH flag is removed and the payload is
    issued.  The problem fixed by this commit is that both the empty flush
    bio and the data payload will account the full extent of the data
    payload.
    
    Fix this by factoring out dm_io_acct() and having it wrap all IO
    accounting to set the size of  bio with REQ_PREFLUSH to 0, account the
    IO, and then restore the original size.
    
    Cc: stable@vger.kernel.org
    Signed-off-by: default avatarMike Snitzer <snitzer@redhat.com>
    8d394bc4
dm.c 67.5 KB