Instead of returning an inconclusive value of NULL for an error in callingReviewed-by: Hannes Reinecke <hare@xxxxxxx>
bio_split(), return a ERR_PTR() always.
Also remove the BUG_ON() calls, and WARN_ON_ONCE() instead. Indeed, since
almost all callers don't check the return code from bio_split(), we'll
crash anyway (for those failures).
Fix up the only user which checks bio_split() return code today (directly
or indirectly), blk_crypto_fallback_split_bio_if_needed(). The md/bcache
code does check the return code in cached_dev_cache_miss() ->
bio_next_split() -> bio_split(), but only to see if there was a split, so
there would be no change in behaviour here (when returning a ERR_PTR()).
Reviewed-by: Christoph Hellwig <hch@xxxxxx>
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@xxxxxxx>
Signed-off-by: John Garry <john.g.garry@xxxxxxxxxx>
---
block/bio.c | 10 ++++++----
block/blk-crypto-fallback.c | 2 +-
2 files changed, 7 insertions(+), 5 deletions(-)