Skip to content
  • Anton Nefedov's avatar
    f3444466
    block: add empty account cookie type · f3444466
    Anton Nefedov authored
    
    
    Each block_acct_done/failed call is designed to correspond to a
    previous block_acct_start call, which initializes the stats cookie.
    However sometimes it is not the case, e.g. some error paths might
    report the same cookie twice because it is hard to accurately track if
    the cookie was reported yet or not.
    
    This patch cleans the cookie after report.
    (Note: block_acct_failed/done without a previous block_acct_start at
    all should be avoided. Uninitialized cookie might hold a garbage value
    and there is still "< BLOCK_MAX_IOTYPE" assertion for that)
    
    It will be particularly useful in ide code where it's hard to
    keep track whether the request done its accounting or not: in the
    following patch of the series, trim requests will do the accounting
    separately.
    
    Signed-off-by: default avatarAnton Nefedov <anton.nefedov@virtuozzo.com>
    Reviewed-by: default avatarVladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
    Message-id: 20190923121737.83281-4-anton.nefedov@virtuozzo.com
    Signed-off-by: default avatarMax Reitz <mreitz@redhat.com>
    f3444466
    block: add empty account cookie type
    Anton Nefedov authored
    
    
    Each block_acct_done/failed call is designed to correspond to a
    previous block_acct_start call, which initializes the stats cookie.
    However sometimes it is not the case, e.g. some error paths might
    report the same cookie twice because it is hard to accurately track if
    the cookie was reported yet or not.
    
    This patch cleans the cookie after report.
    (Note: block_acct_failed/done without a previous block_acct_start at
    all should be avoided. Uninitialized cookie might hold a garbage value
    and there is still "< BLOCK_MAX_IOTYPE" assertion for that)
    
    It will be particularly useful in ide code where it's hard to
    keep track whether the request done its accounting or not: in the
    following patch of the series, trim requests will do the accounting
    separately.
    
    Signed-off-by: default avatarAnton Nefedov <anton.nefedov@virtuozzo.com>
    Reviewed-by: default avatarVladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
    Message-id: 20190923121737.83281-4-anton.nefedov@virtuozzo.com
    Signed-off-by: default avatarMax Reitz <mreitz@redhat.com>
Loading