Skip to content
  • Gu Zheng's avatar
    bio-integrity: add "bip_max_vcnt" into struct bio_integrity_payload · cbcd1054
    Gu Zheng authored
    Commit 08778795
    
     ("block: Fix nr_vecs for inline integrity vectors") from
    Martin introduces the function bip_integrity_vecs(get the useful vectors)
    to fix the issue about nr_vecs for inline integrity vectors that reported
    by David Milburn.
    
    But it seems that bip_integrity_vecs() will return the wrong number if the
    bio is not based on any bio_set for some reason(bio->bi_pool == NULL),
    because in that case, the bip_inline_vecs[0] is malloced directly.  So
    here we add the bip_max_vcnt to record the count of vector slots, and
    cleanup the function bip_integrity_vecs().
    
    Signed-off-by: default avatarGu Zheng <guz.fnst@cn.fujitsu.com>
    Cc: Martin K. Petersen <martin.petersen@oracle.com>
    Cc: Kent Overstreet <kmo@daterainc.com>
    Signed-off-by: default avatarJens Axboe <axboe@fb.com>
    cbcd1054